feat(docker): add docker-compose.yml and .dockerignore for production

This commit is contained in:
Thorsten Bus 2026-03-31 09:19:54 +02:00
parent fa10d792fa
commit 2645aff3af
2 changed files with 60 additions and 41 deletions

View file

@ -1,10 +1,37 @@
node_modules
vendor
.git .git
.gitignore
.gitattributes
.env .env
.env.*
!.env.example
.sisyphus/
.dev.pid
.DS_Store
.editorconfig
.php-cs-fixer.cache
vendor/
node_modules/
tests/
test-results/
phpunit.xml
playwright.config.ts
.idea/
.vscode/
*.swp
*.swo
docs/
README.md
ref/
start_dev.sh
stop_dev.sh
use_local_pp_lib.sh
storage/logs/* storage/logs/*
storage/framework/cache/* storage/framework/cache/*
storage/framework/views/* storage/framework/views/*
test-results storage/framework/sessions/*
tests/e2e/.auth
.dev.pid

View file

@ -1,3 +1,23 @@
# =============================================================================
# Caddy configuration (add to your Caddy instance's Caddyfile):
#
# your-domain.example.com {
# root * /path/on/caddy/host/to/pp-planer/public
# php_fastcgi pp-planer-app:9000 {
# root /app/public
# }
# file_server
# encode gzip
# }
#
# Notes:
# - "root *" = path on the Caddy HOST to the bind-mounted ./public directory
# - "root /app/public" inside php_fastcgi = path INSIDE this container
# - "pp-planer-app" resolves via the shared "caddy" Docker network
# - Both Caddy and this container must be on the "caddy" external network
# - The ./public directory is bind-mounted so Caddy can serve static files
# =============================================================================
services: services:
app: app:
build: build:
@ -5,54 +25,23 @@ services:
dockerfile: build/Dockerfile dockerfile: build/Dockerfile
container_name: pp-planer-app container_name: pp-planer-app
restart: unless-stopped restart: unless-stopped
working_dir: /app
environment:
- WWWUSER=${WWWUSER:-1000}
- WWWGROUP=${WWWGROUP:-1000}
- APP_ENV=${APP_ENV}
- APP_DEBUG=${APP_DEBUG}
- APP_KEY=${APP_KEY}
- APP_URL=${APP_URL}
- DB_CONNECTION=${DB_CONNECTION}
- CTS_API_URL=${CTS_API_URL}
- CTS_API_TOKEN=${CTS_API_TOKEN}
- CHURCHTOOLS_URL=${CHURCHTOOLS_URL}
- CHURCHTOOLS_CLIENT_ID=${CHURCHTOOLS_CLIENT_ID}
- CHURCHTOOLS_CLIENT_SECRET=${CHURCHTOOLS_CLIENT_SECRET}
- CHURCHTOOLS_REDIRECT_URI=${CHURCHTOOLS_REDIRECT_URI}
volumes: volumes:
- ./:/app - ./.env:/app/.env:ro
- /app/node_modules - ./storage:/app/storage
- /app/vendor - ./database:/app/database
- ./public:/app/public
expose: expose:
- "9000" - "9000"
networks: networks:
- caddy - caddy
- internal - internal
node:
image: node:20-alpine
container_name: pp-planer-node
restart: unless-stopped
working_dir: /app
environment:
- NODE_ENV=development
volumes:
- ./:/app
- /app/node_modules
expose:
- "5173"
networks:
- caddy
- internal
command: sh -c "npm install && npm run dev"
# mysql: # mysql:
# image: mysql:8.0 # image: mysql:8.0
# container_name: pp-planer-mysql # container_name: pp-planer-mysql
# restart: unless-stopped # restart: unless-stopped
# environment: # environment:
# MYSQL_DATABASE: ${DB_DATABASE} # MYSQL_DATABASE: ${DB_DATABASE:-pp_planer}
# MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} # MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
# MYSQL_PASSWORD: ${DB_PASSWORD} # MYSQL_PASSWORD: ${DB_PASSWORD}
# MYSQL_USER: ${DB_USERNAME} # MYSQL_USER: ${DB_USERNAME}
@ -61,6 +50,9 @@ services:
# networks: # networks:
# - internal # - internal
# volumes:
# mysql_data:
networks: networks:
caddy: caddy:
external: true external: true