-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (108 loc) · 2.42 KB
/
docker-compose.yml
File metadata and controls
115 lines (108 loc) · 2.42 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
105
106
107
108
109
110
111
112
113
114
115
# docker-compose.yml
# Required environment variables:
# TARGET - The target environment to build the frontend for
# (development, production)
services:
nginx:
container_name: stagehunter-nginx
build:
context: ./nginx
dockerfile: Dockerfile
target: development
ports:
- 80:80
- 443:443
networks:
- frontend-network
restart: unless-stopped
depends_on:
frontend:
condition: service_healthy
backend:
condition: service_healthy
frontend:
container_name: stagehunter-frontend
build:
context: ./frontend
dockerfile: Dockerfile
target: development
ports:
- 3000:3000
volumes:
- ./frontend:/app
- /app/.next
- /app/node_modules
networks:
- frontend-network
environment:
- NODE_OPTIONS=${NODE_OPTIONS}
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000/status"]
interval: 1m
timeout: 15s
retries: 4
start_period: 10m
start_interval: 5s
backend:
container_name: stagehunter-backend
build:
context: ./backend
dockerfile: Dockerfile
ports:
- 8080:8080
env_file:
- ./backend/.env
networks:
- frontend-network
- backend-network
volumes:
- ./backend/.pgpass:/root/.pgpass
restart: unless-stopped
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/v1/daily"]
interval: 1m
timeout: 15s
retries: 4
start_period: 10m
start_interval: 5s
db:
container_name: stagehunter-db
build:
context: ./db
dockerfile: Dockerfile
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /run/secrets/pg_password
restart: unless-stopped
networks:
- backend-network
volumes:
- pgdata:/var/lib/postgresql/data
secrets:
- pg_password
healthcheck:
test: ["CMD", "pg_isready", "-U", "go_prog_user", "-d", "stagehunter"]
interval: 1m
timeout: 15s
retries: 4
start_period: 10m
start_interval: 5s
volumes:
pgdata:
networks:
frontend-network:
driver: bridge
backend-network:
driver: bridge
secrets:
pg_password:
file: ./db/.pg_password