-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (59 loc) · 1.3 KB
/
docker-compose.yml
File metadata and controls
64 lines (59 loc) · 1.3 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
version: '3.8'
services:
# Servicio principal de desarrollo
pythonCDMX:
build: .
container_name: pythonCDMX-dev
ports:
- "8000:8000"
volumes:
- .:/app
- /app/site # Excluir directorio de build
environment:
- PYTHONPATH=/app
- MKDOCS_DEV_ADDR=0.0.0.0:8000
command: mkdocs serve --dev-addr=0.0.0.0:8000 --livereload
restart: unless-stopped
networks:
- python-cdmx-network
# Servicio de producción (build estático)
pythonCDMX-prod:
build: .
container_name: pythonCDMX-prod
ports:
- "8080:80"
volumes:
- ./site:/usr/share/nginx/html:ro
environment:
- NODE_ENV=production
command: >
sh -c "
mkdocs build &&
nginx -g 'daemon off;'
"
depends_on:
- pythonCDMX
networks:
- python-cdmx-network
# Servicio de nginx para producción
nginx:
image: nginx:alpine
container_name: python-cdmx-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./site:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- pythonCDMX-prod
networks:
- python-cdmx-network
profiles:
- production
networks:
python-cdmx-network:
driver: bridge
volumes:
site-data: