-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
104 lines (98 loc) · 3.08 KB
/
docker-compose.prod.yml
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
services:
reverse-proxy:
image: traefik:v3.1
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--entryPoints.web.http.redirections.entrypoint.to=websecure"
- "--entryPoints.web.http.redirections.entrypoint.scheme=https"
- "--entryPoints.web.http.redirections.entrypoint.permanent=true"
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
- "--certificatesresolvers.letsencrypt.acme.storage=/etc/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
# - "4080:8080"
networks:
- reverse_proxy
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
frontend:
image: ${FRONT_IMAGE}
depends_on:
- backend
networks:
- reverse_proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.spacefest_frontend.rule=Host(`spacechamp-org.ru`)"
- "traefik.http.routers.spacefest_frontend.entrypoints=websecure"
- "traefik.http.routers.spacefest_frontend.tls=true"
- "traefik.http.routers.spacefest_frontend.tls.certresolver=letsencrypt"
- "traefik.http.services.spacefest_frontend.loadBalancer.server.port=80"
backend:
image: ${BACK_IMAGE}
command:
- "--db-url"
- "postgresql://postgres:postgres@postgres:5432/spacechamp"
- "--addr"
- "0.0.0.0:80"
- "--sessions-path"
- "/var/lib/backend/sessions.json"
- "--notisend-token"
- "$NOTISEND_TOKEN"
environment:
- NOTISEND_TOKEN=${NOTISEND_TOKEN}
volumes:
- "spacechamp-backend-data:/var/lib/backend"
networks:
- reverse_proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.spacefest_backend.rule=Host(`spacechamp-org.ru`) && PathPrefix(`/api/v1`)"
- "traefik.http.routers.spacefest_backend.entrypoints=websecure"
- "traefik.http.routers.spacefest_backend.tls=true"
- "traefik.http.routers.spacefest_backend.tls.certresolver=letsencrypt"
- "traefik.http.services.spacefest_backend.loadBalancer.server.port=80"
depends_on:
# report-generator
postgres:
condition: service_healthy
report-generator:
image: ${REPORT_GEN_IMAGE}
command:
- "--host"
- "0.0.0.0"
- "--port"
- "8866"
networks:
- reverse_proxy
postgres:
image: postgres:latest
user: postgres
environment:
POSTGRES_DB: "spacechamp"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
PGDATA: "/var/lib/postgresql/data/pgdata"
volumes:
- "spacechamp-postgres-data:/var/lib/postgresql/data"
networks:
- reverse_proxy
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 2s
retries: 10
restart: unless-stopped
networks:
reverse_proxy:
volumes:
spacechamp-backend-data:
external: true
spacechamp-postgres-data:
external: true