-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
111 lines (105 loc) · 3.25 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
105
106
107
108
109
110
111
services:
database:
restart: always
image: postgres:17
container_name: t-poo-700-stg_9_database
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
backend:
restart: always
image: elixir:1.17
container_name: t-poo-700-stg_9_backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`${BACKEND_DNS}`)"
- "traefik.http.routers.backend.entrypoints=websecure"
- "traefik.http.routers.backend.tls.certresolver=letsencrypt"
- "traefik.http.services.backend.loadbalancer.server.port=4000"
command: >
bash -c "mix local.hex --force && mix deps.get && mix ecto.migrate && mix phx.digest && mix phx.server"
working_dir: /app
environment:
DATABASE_HOSTNAME: ${DATABASE_HOSTNAME}
CLIENT_ID_GOOGLE: ${CLIENT_ID}
CLIENT_SECRET_GOOGLE: ${CLIENT_SECRET}
volumes:
- ./backend:/app
- backend:/app/_build
- backend:/app/deps
depends_on:
- database
frontend:
restart: always
image: node:lts-bullseye
container_name: t-poo-700-stg_9_frontend
working_dir: /app
volumes:
- ./frontend:/app
environment:
NODE_ENV: prod
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`${FRONTEND_DNS}`)"
- "traefik.http.routers.frontend.entrypoints=websecure"
- "traefik.http.routers.frontend.tls.certresolver=letsencrypt"
- "traefik.http.services.frontend.loadbalancer.server.port=5173"
command: /bin/sh -c "npm install && npm run build && npm run preview"
depends_on:
- traefik
traefik:
restart: always
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
- "8080:8080"
labels:
- "traefik.enable=true"
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
volumes:
- ./traefik.yml:/etc/traefik/traefik.yml
- /var/run/docker.sock:/var/run/docker.sock
- certs:/acme
- ./volumes/traefik/logs:/logs
- ./tls.yml:/etc/traefik/tls.yml
- certs:/etc/ssl/traefik
pgadmin:
restart: always
image: dpage/pgadmin4
container_name: t-poo-700-stg_9_pg_admin
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
labels:
- "traefik.enable=true"
- "traefik.http.routers.pgadmin.rule=Host(`${PGADMIN_DNS}`)"
- "traefik.http.routers.pgadmin.entrypoints=websecure"
- "traefik.http.routers.pgadmin.tls.certresolver=letsencrypt"
- "traefik.http.services.pgadmin.loadbalancer.server.port=80"
depends_on:
- database
- traefik
volumes:
- pgadmin:/var/lib/pgadmin
reverse-proxy-https-helper:
image: alpine
command: sh -c "cd /etc/ssl/traefik
&& wget traefik.me/cert.pem -O cert.pem
&& wget traefik.me/privkey.pem -O privkey.pem"
volumes:
- certs:/etc/ssl/traefik
volumes:
postgres_data:
name: t-poo-700-stg_9_postgres_data
certs:
name: t-poo-700-stg_9_certs
pgadmin:
name: t-poo-700-stg_9_pgadmin
traefik:
name: t-poo-700-stg_9_traefik
backend:
name: t-poo-700-stg_9_backend