-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample--docker-compose.yml
More file actions
executable file
·105 lines (93 loc) · 2.28 KB
/
example--docker-compose.yml
File metadata and controls
executable file
·105 lines (93 loc) · 2.28 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
104
# --- EXAMPLE --- docker-compose.yml -----------------------------------------------------------------------------
# --- Red privada ---
networks:
net:
driver: bridge
# --- Servicios ---
services:
# --- Servicio de WebServer - desarrollo ---
dev-server:
image: symfony-webapp-server:php-8.3-dev
container_name: webdev
ports:
- "8080:80"
volumes:
# Montar la carpeta de la app
- ./webapp:/var/www/html
- ./config/php.ini-dev:/etc/php/8.3/fpm/php.ini
depends_on:
- db
networks:
- net
profiles:
- development
# --- Servicio de WebServer - producción ---
prod-server:
image: symfony-webapp-server:php-8.3-prod
container_name: webprod
env_file:
- ./.env
ports:
- "8081:80"
depends_on:
- db
networks:
- net
restart: unless-stopped
profiles:
- production
# --- Servicio de Base de Datos ---
db:
image: postgres:16-alpine # Usamos la imagen ligera de Alpine
container_name: database
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
healthcheck:
test: [ "CMD", "pg_isready", "-d", "${DB_DATABASE:-app}", "-U", "${DB_USER:-app}" ]
timeout: 5s
retries: 5
start_period: 60s
volumes:
- postgres_data:/var/lib/postgresql/data # Volumen para persistir los datos
# ports:
# - "5433:5432"
networks:
- net
profiles:
- development
- production
# --- Servicio de cache (Redis) ---
redis:
image: redis:7-alpine
container_name: redis
volumes:
- redis_data:/data
networks:
- net
profiles:
- development
- production
########################################
# SERVICIOS SOLO PARA DESARROLLO
########################################
mailpit:
image: axllent/mailpit
container_name: mailpit
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
ports:
- "1025:1025" # Puerto SMTP para la app
- "8025:8025" # Interfaz web de Mailpit
networks:
- net
profiles:
- development # Mailpit solo corre en desarrollo
# --- Volúmenes Nombrados ---
volumes:
postgres_data:
driver: local
redis_data:
driver: local