Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker GitHub workflow #4

Merged

Conversation

jameskitt616
Copy link

  • Added github workflow to build and publish docker images when releasing a new git tag
  • Updated the standalone compose file with necessary programs
  • Update Readme instructions for docker compose install.

@jameskitt616 jameskitt616 marked this pull request as draft May 30, 2024 10:56
@jameskitt616 jameskitt616 marked this pull request as ready for review June 7, 2024 21:59
Comment on lines 10 to 20
Recommended way via Docker Compose:

1. Copy and configure your docker compose file to your needs `curl -L -o compose.yaml https://raw.githubusercontent.com/Ctrlpanel-gg/panel/blob/main/docker/standalone/compose.yaml`.
2. Create the env file in the same directory as the compose file `touch env_file`.
3. When installing you need to update the `env_file` file. Change those two variables to: `MEMCACHED_HOST=redis` and `REDIS_HOST=redis`, to use the Redis server which comes with the docker compose installation.

Running as commandline command:

```bash
docker run -p 80:80 -p 443:443 -v /path/to/website_files:/var/www/html -v /path/to/nginx_config:/etc/nginx/conf.d/ ctrlpanel/ctrlpanel
docker run -p 80:80 -p 443:443 -v /path/to/website_files:/var/www/html -v /path/to/nginx_config:/etc/nginx/conf.d/ ghcr.io/ctrlpanel-gg/panel:latest
```
Copy link
Owner

@S0ly S0ly Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here I think that you should reverse the two, since the docker run command is the most used :D

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand what you mean. i just changed this so it will use the docker image which will be available on the github container registry. the ctrlpanel/ctrlpanel does not exist anywhere. Please elaborate what you mean by this.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I just mean the two section put the docker command above the docker compose

ports:
- "80:80"
- "443:443"
volumes:
- '../..:/var/www/html:rw'
- './nginx_config:/etc/nginx/conf.d/:rw'
networks:
- laravel
- controlpanel
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to change all control panel to ctrlpanel :) to be like the 0.10

Comment on lines -14 to +13
- './website_files:/var/www/html:rw' # change it
- './nginx_config:/etc/nginx/conf.d/:rw' # change it
- './logs:/var/www/html/storage/logs:w'
- './env_file:/var/www/html/.env'
Copy link
Owner

@S0ly S0ly Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately this will not work it need to be like the dev docker, ctrlpanel is not really made to be inside a docker and is executing some command like composer :( and some people have themes and addons
so you need the panel code to always be saved, there will be an update script dont worry :)
so you need website and nginx to be saved as volume

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

executing composer works fine. it installs composer just as it would for a normal install upon container start. i dont see an issue there. for themes and addons i would just need to know in which folders they would be saved and they could be exposed just like the logs.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah having composer install at each start is not very great, and most people use theme and addons which are not supported by default they change files of the panel any file

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have exactly the same issue whit the pterodactyl panel where I need the file for my modified ptero and each time I start it it’s re uploading default configuration of eggs and it’s very annoying

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not running composer install on every container startup.
And for themes and addons, as i said, if you tell me what directories i need to be exposed, i can add a bind mount for them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it, please review.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the current standalone will still not work whit addons and modification, adding by default the project files would be better :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not agree with that. I changed it so the project files are exposed by default. Here a couple reasons:

  • You yourself told me a few days ago: the lesser permission the better -> the normal user doesn't need access to the project files at all
  • It might confuse users since they most likely wont need this anyways.
  • It's a weird a bad practice

So i still think having by default the project files NOT exposed would be the much more appropriate way. And the people still got the option to safely expose them at any time later if they need to, without breaking anything. Exposing it by default just introduces different problems.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like I said ctrlpanel does not support addons correctly in the code and need the project files exposed for that, many people use a modified panel
and the default nginx config will be invalid since it need to be changed
these two things need to be exposed or available for exposing
but the nginx config is really needed (for SSL and things)
and it does not concern permission they are the same if there is a volume or not

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the nginx config of the docker container needs to be touched for addons, i guess thats alright. but it shouldnt be touched at all for any SSL/TLS stuff, that should absolutely be handled outside of the docker container by a reverse proxy and absolutely NOT by ctrlpanel itself ever!!!
if the docker compose comes with some reverse proxy, thats totally fine and legit. but the nginx inside of the docker container handling the stuff for the panel shouldn't do any of the TLS stuff!

I re-added the nginx config bind mount on your wish.

@S0ly
Copy link
Owner

S0ly commented Jun 9, 2024

and I think that's all

@jameskitt616
Copy link
Author

Ready to merge from my side

@S0ly S0ly merged commit 81fe738 into S0ly:feature/standalone-docker Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants