-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
82 lines (81 loc) · 2.1 KB
/
docker-compose.yaml
File metadata and controls
82 lines (81 loc) · 2.1 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
services:
api:
build:
context: ./src/api
args:
NODE_VERSION: ${NODE_VERSION:-20.18.0}
depends_on:
db:
condition: service_healthy
environment:
- API_PORT=3000
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_ACCOUNT_NUMBER=${AWS_ACCOUNT_NUMBER}
- AWS_BUCKET_NAME=${AWS_BUCKET_NAME}
- AWS_REGION=${AWS_REGION}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_SQS_QUEUE_NAME=${AWS_SQS_QUEUE_NAME}
- AWS_SQS_REQUEUE_DELAY=${AWS_SQS_REQUEUE_DELAY}
- AWS_SQS_REQUEUE_MAX_RETRIES=${AWS_SQS_REQUEUE_MAX_RETRIES}
- DB_HOST=db
- DB_NAME=${DB_NAME}
- DB_PASS=${DB_PASS}
- DB_PORT=5432
- DB_USER=${DB_USER}
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"localhost:3000/healthcheck"
]
interval: 2s
timeout: 5s
retries: 5
ports:
- '${API_PORT}:3000'
volumes:
- ./src/api/:/code
# NOTE: Below exclusion for API may not be needed, but including for consistency since 'web' includes it.
# Exclude host's node_modules for container and processor architecture compatibility.
- /code/node_modules/
db:
image: postgres:15.4
healthcheck:
test:
[
'CMD-SHELL',
'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB'
]
interval: 2s
timeout: 5s
retries: 5
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_USER: ${DB_USER}
ports:
- '${DB_PORT}:5432'
# volumes:
# - pgdata:/var/lib/postgresql/data
web:
build:
context: ./src/web
args:
NODE_VERSION: ${NODE_VERSION:-20.18.0}
command: npm run dev:docker
depends_on:
api:
condition: service_healthy
environment:
- VITE_API_PORT=${VITE_API_PORT}
- WEB_PORT=5173
ports:
- '${WEB_PORT}:5173'
volumes:
- ./src/web/:/code
# Exclude host's node_modules for container and processor architecture compatibility.
- /code/node_modules/
# volumes:
# pgdata: