forked from kphrx/plc-handle-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
117 lines (108 loc) · 2.58 KB
/
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
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
116
117
x-shared_environment: &shared_environment
LOG_LEVEL: info
REDIS_URL: redis://redis:6379
DATABASE_HOST: db
DATABASE_NAME: vapor_database
DATABASE_USERNAME: vapor_username
DATABASE_PASSWORD: vapor_password
services:
db:
image: postgres:16-alpine
restart: always
healthcheck:
test: ["CMD", "pg_isready", "-U", "vapor_username", "-d", "vapor_database"]
timeout: 60s
volumes:
- "db_data:/var/lib/postgresql/data/pgdata"
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: vapor_username
POSTGRES_PASSWORD: vapor_password
POSTGRES_DB: vapor_database
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --locale=C"
redis:
image: redis:7-alpine
restart: always
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
timeout: 60s
volumes:
- "redis_data:/data"
app:
image: ghcr.io/kphrx/plc-handle-tracker:latest
build:
context: .
restart: always
healthcheck:
test: ["CMD", "bash", "-c", "':> /dev/tcp/127.0.0.1/8080'", "||", "exit", "1"]
timeout: 15s
environment:
<<: *shared_environment
depends_on:
- db
- redis
# ports:
# - '8080:8080'
command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8080"]
migrate:
image: ghcr.io/kphrx/plc-handle-tracker:latest
build:
context: .
environment:
<<: *shared_environment
depends_on:
- db
command: ["migrate", "--yes"]
deploy:
replicas: 0
revert:
image: ghcr.io/kphrx/plc-handle-tracker:latest
build:
context: .
environment:
<<: *shared_environment
depends_on:
- db
command: ["migrate", "--revert", "--yes"]
deploy:
replicas: 0
default_worker:
image: ghcr.io/kphrx/plc-handle-tracker:latest
build:
context: .
restart: always
environment:
<<: *shared_environment
depends_on:
- db
- redis
command: ["queues"]
# deploy:
# replicas: 2 # scaling
polling_worker:
image: ghcr.io/kphrx/plc-handle-tracker:latest
build:
context: .
restart: always
environment:
<<: *shared_environment
depends_on:
- db
- redis
command: ["queues", "--queue", "polling"]
# deploy:
# replicas: 2 # scaling
schedule_worker:
image: ghcr.io/kphrx/plc-handle-tracker:latest
build:
context: .
restart: always
environment:
<<: *shared_environment
depends_on:
- db
- redis
command: ["queues", "--scheduled"]
volumes:
db_data:
redis_data: