This repository has been archived by the owner on Oct 29, 2023. It is now read-only.
forked from jphacks/NG_2304
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
84 lines (79 loc) · 1.69 KB
/
docker-compose.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
version: "3"
services:
api:
container_name: api
build: ./api
image: api:${API_VERSION:-latest}
ports:
- 8000:8000
restart: always
depends_on:
db:
condition: service_healthy
volumes:
- ./api:/app
- venv:/app/.venv
environment:
API_RELOAD: true
API_HOST: 0.0.0.0
API_PORT: 8000
API_DB_HOST: db
API_DB_PORT: 5432
API_DB_USER: postgres_user
API_DB_PASS: postgres_password
API_DB_BASE: app
web:
container_name: web
build: ./web
ports:
- 3000:3000
volumes:
- ./web:/app
- next_build:/app/.next
- node_modules:/app/node_modules
restart: always
tty: true
stdin_open: true
environment:
- CHOKIDAR_USEPOLLING=true
depends_on:
- api
db:
container_name: database
image: postgres:16-bullseye
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres_user
POSTGRES_PASSWORD: postgres_password
POSTGRES_DB: app
encoding: utf8
volumes:
- db_data:/var/lib/postgresql/data
restart: always
healthcheck:
test: pg_isready -U postgres_user -d app
interval: 2s
timeout: 3s
retries: 40
migrator:
container_name: migrator
image: api:${API_VERSION:-latest}
restart: on-failure
command: /app/.venv/bin/python -m alembic upgrade head
environment:
API_DB_HOST: db
API_DB_PORT: 5432
API_DB_USER: postgres_user
API_DB_PASS: postgres_password
API_DB_BASE: app
depends_on:
db:
condition: service_healthy
api:
condition: service_started
volumes:
venv:
next_build:
node_modules:
db_data: