-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (78 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
82 lines (78 loc) · 1.91 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
version: '3.8'
services:
postgres:
image: postgres:15
container_name: gopher_chess_db
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER}" ]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
migrate:
image: arigaio/atlas:latest-alpine
container_name: gopher_chess_migrate
environment:
DB_SSLMODE: ${DB_SSLMODE}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
command:
- migrate
- apply
- --dir
- file:///migrations
- --url
- postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE}?search_path=public&sslmode=${DB_SSLMODE}
- --revisions-schema
- public
volumes:
- ./ent/migrate/migrations:/migrations
depends_on:
- postgres
restart: on-failure
backend:
build:
context: .
dockerfile: Dockerfile
container_name: gopher_chess_backend
ports:
- "8000:8000"
environment:
ENV: ${ENV}
DB_HOST: postgres
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
DB_SSLMODE: ${DB_SSLMODE}
JWT_SECRET: ${JWT_SECRET}
EXP_TIME: ${EXP_TIME}
depends_on:
- postgres
- migrate
volumes:
- ./ent/migrate/migrations:/app/ent/migrate/migrations
restart: unless-stopped
frontend:
build:
context: ./frontend-react
dockerfile: Dockerfile
args:
REACT_APP_API_URL: ${REACT_APP_API_URL}
REACT_APP_WS_URL: ${REACT_APP_WS_URL}
container_name: gopher_chess_frontend
ports:
- "80:80"
depends_on:
- backend
restart: unless-stopped
volumes:
postgres_data: