-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (99 loc) · 2.9 KB
/
docker-compose.yml
File metadata and controls
103 lines (99 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
services:
db:
image: mysql:8.0
container_name: pteroca_mysql_dev
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: pteroca
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
volumes:
- db_data_dev:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: pteroca_phpmyadmin_dev
restart: always
ports:
- "8080:80"
environment:
PMA_HOST: db
PMA_USER: root
PMA_PASSWORD: root
# Increase upload limits for database imports
UPLOAD_LIMIT: 128M
MAX_EXECUTION_TIME: 300
MEMORY_LIMIT: 512M
depends_on:
- db
mailhog:
image: mailhog/mailhog
container_name: pteroca_mailhog_dev
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
restart: unless-stopped
web:
build:
context: .
args:
APP_ENV: dev
container_name: pteroca_web_dev
ports:
- "8000:8000"
environment:
DATABASE_URL: "mysql://user:password@db:3306/pteroca?serverVersion=8.0"
APP_ENV: dev
CURL_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
depends_on:
db:
condition: service_healthy
mailhog:
condition: service_started
volumes:
# Live source code sync - changes on host immediately visible in container
- ./src:/app/src
- ./themes:/app/themes
- ./templates:/app/templates
- ./config:/app/config
- ./migrations:/app/migrations
- ./plugins:/app/plugins
- ./public:/app/public
- ./tests:/app/tests
- ./.env:/app/.env
# Persistent data volumes
- app_var_dev:/app/var # Persist cache/logs across restarts
- app_uploads_dev:/app/public/uploads # Persist user uploads across restarts
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
working_dir: /app
command: >
sh -c "
echo 'Waiting for database to be ready...'
until php bin/console doctrine:query:sql 'SELECT 1' > /dev/null 2>&1; do
echo 'Database not ready yet, waiting...'
sleep 2
done
echo 'Database is ready, installing assets...'
php bin/console assets:install public --symlink --relative
echo 'Running migrations...'
php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
echo 'Migrations completed successfully!'
mkdir -p /app/var/log /app/var/cache /app/public/uploads
echo 'Starting PHP development server with router script...'
php -S 0.0.0.0:8000 -t public/ public/router.php
"
restart: unless-stopped
env_file:
- .env
volumes:
db_data_dev:
app_var_dev:
app_uploads_dev: