-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (100 loc) · 3.26 KB
/
Copy pathdocker-compose.yml
File metadata and controls
104 lines (100 loc) · 3.26 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
# =============================================================================
# Docker Compose - BASE CONFIGURATION
# =============================================================================
# Usage:
# Development: docker compose -f docker-compose.yml -f docker-compose.dev.yml up
# Production: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# Ou simplement (utilise les images pré-buildées):
# docker compose up # Utilise les images par défaut (dev)
# =============================================================================
services:
# ---------------------------------------------------------------------------
# App (Next.js)
# ---------------------------------------------------------------------------
app:
image: ${APP_IMAGE:-app:dev}
user: "1000:1000"
env_file:
- .env.local
environment:
- NODE_ENV=${NODE_ENV:-development}
- NEXT_TELEMETRY_DISABLED=1
restart: unless-stopped
networks:
- app_network
- db_openportability_db_network
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3000:3000"
volumes:
- shared-tmp:/app/tmp
- app_logs:/app/logs
# depends_on:
# - worker
# ---------------------------------------------------------------------------
# Worker (Background jobs)
# ---------------------------------------------------------------------------
worker:
image: ${WORKER_IMAGE:-worker:dev}
user: "1000:1000"
env_file:
- ./worker/.env
environment:
- NODE_ENV=${NODE_ENV:-development}
- NEXT_TELEMETRY_DISABLED=1
restart: unless-stopped
networks:
- app_network
- db_openportability_db_network
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- shared-tmp:/app/tmp
- app_logs:/app/logs
# ---------------------------------------------------------------------------
# Nginx (Reverse proxy)
# ---------------------------------------------------------------------------
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/certs:/etc/nginx/certs:ro
- ./nginx/auth:/etc/nginx/auth:ro
- ./nginx/security.conf:/etc/nginx/security.conf:ro
- ./nginx/logs:/var/log/nginx
depends_on:
- app
networks:
- app_network
restart: unless-stopped
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
# =============================================================================
# Networks
# =============================================================================
networks:
app_network:
driver: bridge
db_openportability_db_network:
external: true
name: db_openportability_db_network
# =============================================================================
# Volumes
# =============================================================================
volumes:
shared-tmp:
driver: local
driver_opts:
type: tmpfs
device: tmpfs
o: "noexec,uid=1000,gid=1000,mode=0775"
app_logs:
driver: local
driver_opts:
type: none
device: /home/ubuntu/openportability_logs
o: "bind,noexec"