feat: Shared code volume for nginx and app containers

- Add app-code volume to both nginx and app containers
- App container clones code once into shared volume
- Nginx container uses shared volume (read-only) and waits for code
- Update entrypoint.sh to handle storage-preserving git clone
- Fix nginx configuration to use app:9000 for PHP-FPM

This eliminates duplicate code cloning and ensures both containers
always use the same code version from the shared volume.
This commit is contained in:
2025-10-31 23:37:29 +01:00
parent 9e39a7b14e
commit 01fcd690e2
2 changed files with 18 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ services:
- APP_ENV=${APP_ENV:-production}
- APP_DEBUG=${APP_DEBUG:-false}
- APP_URL=${APP_URL:-https://michaelschiemer.de}
- APP_KEY=${APP_KEY:-}
# Git Repository (optional - if set, container will clone/pull code on start)
- GIT_REPOSITORY_URL=${GIT_REPOSITORY_URL:-}
- GIT_BRANCH=${GIT_BRANCH:-main}
@@ -39,6 +40,7 @@ services:
- QUEUE_DRIVER=redis
- QUEUE_CONNECTION=default
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-logs:/var/www/html/storage/logs
- /etc/timezone:/etc/timezone:ro