-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yaml
71 lines (71 loc) · 1.7 KB
/
compose.yaml
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
# cspell:words initdb healthcheck pg_isready
services:
web:
build:
context: ./packages
dockerfile: ./ui/Dockerfile
ports:
- "8080:80"
net:
build:
context: ./packages
dockerfile: ./cli/Dockerfile
args:
- BIN=network_execute
depends_on:
db:
condition: service_healthy
restart: on-failure
cli:
build:
context: ./packages
dockerfile: ./cli/Dockerfile
args:
- BIN=cli
environment:
- ST_AGENT=${ST_AGENT}
- ST_EMAIL=${ST_EMAIL}
- ST_FACTION=${ST_FACTION}
depends_on:
net:
condition: service_started
db:
condition: service_healthy
restart: on-failure
volumes:
- ./packages/cli/static_data:/static_data
- ./packages/cli/data:/data
idle:
build:
context: ./packages
dockerfile: ./cli/Dockerfile
args:
- BIN=idle_queue
depends_on:
net:
condition: service_started
db:
condition: service_healthy
restart: on-failure
volumes:
- ./packages/cli/static_data:/static_data
- ./packages/cli/data:/data
db:
image: postgres:15.3-alpine3.18
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=spacetraders
# Expose the port to other containers.
expose: [5432]
# Carefully *only* expose the port to localhost (for test scripts).
ports: ["127.0.0.1:5432:5432"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- ./db_data:/var/lib/postgresql/data
- ./packages/db/sql/tables:/docker-entrypoint-initdb.d/