forked from Ctrlpanel-gg/panel
-
Notifications
You must be signed in to change notification settings - Fork 1
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
S0ly
merged 48 commits into
S0ly:feature/standalone-docker
from
jameskitt616:docker-github-workflow
Jun 9, 2024
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
3a7dc46
Add docker build workflow
jameskitt616 aa5820c
Add Dockerfile location to github workflow
jameskitt616 1968a97
Update standalone compose file
jameskitt616 93fb0b7
Change repository owner name
jameskitt616 9fef8ab
Update docker readme
jameskitt616 7a40c38
Update docker readme with redis instructions
jameskitt616 86de9ec
Update startup script
jameskitt616 47cdd8e
Add network to dev compose
jameskitt616 956e679
Set database name and user to defaults from installer
jameskitt616 e054cb9
Update permissions
jameskitt616 b3862a4
Try to determine if process is running within a docker container
jameskitt616 aadd164
Force conecole command without exec -a
jameskitt616 e564a38
Comment out everything in run_console command
jameskitt616 b8d6d59
Set different permissions
jameskitt616 c5ad334
Set different permissions
jameskitt616 92c1655
Open up permissions
jameskitt616 fec23ee
Revert stuff in functions.php
jameskitt616 786bac3
Reset permissions
jameskitt616 a2e0109
Update permissions in startup.sh
jameskitt616 76463c9
Add chown to startup.sh
jameskitt616 dffcb25
Add permissions to streamhandler
jameskitt616 0a3cc25
Revert StreamHandler permissions
jameskitt616 d6a01b6
Revert trustedpries
jameskitt616 f523ea6
Revert permissions in startup.sh
jameskitt616 c285f8f
Copy .env file in Dockerfile
jameskitt616 bdffb66
copy env file in startup script
jameskitt616 d6d5fd8
Copy .env.example from different dir
jameskitt616 318781f
Remove reverse parameter from copy single file
jameskitt616 bba697b
Create dir on startup script
jameskitt616 9cffe58
Run copy of project files every time
jameskitt616 a51ff57
ls project dirs to check if they are empty
jameskitt616 7c3d702
Show and set permissions for project folder
jameskitt616 4c833e2
Run copy project files anyways
jameskitt616 863299b
Attempt to fix startup script
jameskitt616 1cb03f5
Add logging to troubleshoot
jameskitt616 06a67fe
Check for public folder instead of if has contents
jameskitt616 9188c42
Remove unnecessary deletion of file
jameskitt616 ebe730b
Test if permissions are necessary
jameskitt616 9e6688d
Remove unnecessary permissions
jameskitt616 44c05b0
Update compose.yaml with only logs and env file
jameskitt616 33096fb
Rename controlpanel to ctrlpanel
jameskitt616 6a5f05e
Fix typo
jameskitt616 05dc11e
Update Readme and stanalone compose
jameskitt616 d210baa
Docker compose default add project files
jameskitt616 01ca75f
Fix typo
jameskitt616 a58aa10
Readd nginx config expose
jameskitt616 628f2c6
Update dev docker service name
jameskitt616 bb9bc29
Update standalone docker service name
jameskitt616 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build-and-push-docker-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
file: docker/standalone/Dockerfile | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
services: | ||
# TODO: add wings and pterodactyl | ||
controlpanel_standalone: | ||
ctrlpanel_development: | ||
build: | ||
context: ../../ | ||
dockerfile: ./docker/standalone/Dockerfile | ||
container_name: controlpanel_development | ||
restart: on-failure | ||
container_name: ctrlpanel_development | ||
restart: unless-stopped | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- '../..:/var/www/html:rw' | ||
- './nginx_config:/etc/nginx/conf.d/:rw' | ||
networks: | ||
- laravel | ||
- ctrlpanel | ||
|
||
mysql: | ||
image: mysql | ||
container_name: controlpanel_mysql | ||
container_name: ctrlpanel_mysql | ||
restart: unless-stopped | ||
tty: true | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_DATABASE: controlpanel | ||
MYSQL_USER: controlpanel | ||
MYSQL_DATABASE: ctrlpanel | ||
MYSQL_USER: ctrlpaneluser | ||
MYSQL_PASSWORD: root | ||
MYSQL_ROOT_PASSWORD: root | ||
volumes: | ||
- "./mysql:/var/lib/mysql:delegated" | ||
networks: | ||
- laravel | ||
- ctrlpanel | ||
|
||
phpmyadmin: | ||
image: phpmyadmin/phpmyadmin | ||
container_name: controlpanel_phpmyadmin | ||
container_name: ctrlpanel_phpmyadmin | ||
depends_on: | ||
- mysql | ||
ports: | ||
- '8080:80' | ||
environment: | ||
- PMA_HOST=controlpanel_mysql | ||
- PMA_HOST=ctrlpanel_mysql | ||
- PMA_USER=root | ||
- PMA_PASSWORD=root | ||
- PMA_ARBITRARY=1 | ||
networks: | ||
- laravel | ||
- ctrlpanel | ||
|
||
redis: | ||
image: redis | ||
container_name: controlpanel_redis | ||
container_name: ctrlpanel_redis | ||
restart: unless-stopped | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- laravel | ||
- ctrlpanel | ||
|
||
networks: | ||
laravel: | ||
ctrlpanel: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,62 @@ | ||
version: '3' | ||
|
||
services: | ||
controlpanel_standalone: | ||
build: | ||
context: ../../ | ||
dockerfile: ./docker/standalone/Dockerfile | ||
container_name: controlpanel_standalone | ||
restart: on-failure | ||
ctrlpanel_standalone: | ||
image: ghcr.io/ctrlpanel-gg/panel:latest | ||
container_name: ctrlpanel_standalone | ||
restart: unless-stopped | ||
depends_on: | ||
- redis | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- './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' | ||
- './website_files:/var/www/html:rw' # optionally remove this bind mount, it's not needed unless you want access to all project files, to modify the project with addons/plugins. | ||
- './nginx_config:/etc/nginx/conf.d/:rw' # optionally remove this bind mount, it's not needed unless you want to modify the project with addons/plugins. (dangerous to edit) | ||
networks: | ||
- ctrlpanel | ||
|
||
mysql: | ||
image: mysql | ||
container_name: ctrlpanel_mysql | ||
restart: unless-stopped | ||
tty: true | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_DATABASE: ctrlpanel | ||
MYSQL_USER: ctrlpaneluser | ||
MYSQL_PASSWORD: root # change it | ||
MYSQL_ROOT_PASSWORD: root # change it | ||
volumes: | ||
- "./mysql:/var/lib/mysql:delegated" | ||
networks: | ||
- ctrlpanel | ||
|
||
phpmyadmin: | ||
image: phpmyadmin/phpmyadmin | ||
container_name: ctrlpanel_phpmyadmin | ||
restart: unless-stopped | ||
depends_on: | ||
- mysql | ||
ports: | ||
- '8080:80' | ||
environment: | ||
- PMA_HOST=ctrlpanel_mysql | ||
- PMA_USER=root # change it | ||
- PMA_PASSWORD=root # change it | ||
- PMA_ARBITRARY=1 | ||
networks: | ||
- ctrlpanel | ||
|
||
redis: | ||
image: redis | ||
container_name: ctrlpanel_redis | ||
restart: unless-stopped | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- ctrlpanel | ||
|
||
networks: | ||
ctrlpanel: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it, please review.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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:
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.