-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (84 loc) · 2.27 KB
/
docker-compose.yml
File metadata and controls
89 lines (84 loc) · 2.27 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
83
84
85
86
87
88
89
services:
db:
image: postgres:16
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nkqueue
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres -d nkqueue || exit 1']
interval: 5s
timeout: 5s
retries: 20
deploy:
resources:
limits:
memory: 384M
migrate:
build: .
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/nkqueue
depends_on:
db:
condition: service_healthy
command: npx node-pg-migrate up
restart: 'no'
seed-settings:
image: postgres:16
depends_on:
migrate:
condition: service_completed_successfully
environment:
PGPASSWORD: postgres
restart: 'no'
command: >
bash -lc "
psql -h db -U postgres -d nkqueue -v ON_ERROR_STOP=1 -c
\"insert into settings
(singleton, queue_category_id, helper_role_id, decay_threshold, decay_amount, decay_interval, decay_grace, match_count_channel_id)
select true,
''::varchar,
''::varchar,
1000, 25, 24, 6, ''::text
where not exists (select 1 from settings where singleton = true);\""
deploy-commands:
build: .
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/nkqueue
DISCORD_TOKEN: ${DISCORD_TOKEN}
CLIENT_ID: ${CLIENT_ID}
GUILD_ID: ${GUILD_ID}
API_TOKEN: ${API_TOKEN}
depends_on:
seed-settings:
condition: service_completed_successfully
command: node dist/scripts/deploy-commands.js
restart: 'no'
bot:
build: .
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/nkqueue
DISCORD_TOKEN: ${DISCORD_TOKEN}
CLIENT_ID: ${CLIENT_ID}
GUILD_ID: ${GUILD_ID}
LOG_DIR: /app/data/logs
API_TOKEN: ${API_TOKEN}
WEBHOOK_URL: ${WEBHOOK_URL}
WEBHOOK_QUERY_SECRET: ${WEBHOOK_QUERY_SECRET}
depends_on:
deploy-commands:
condition: service_completed_successfully
command: bash -lc "exec node dist/index.js"
volumes:
- botlogs:/app/data/logs
ports:
- '4931:4931'
restart: unless-stopped
deploy:
resources:
limits:
memory: 256M
volumes:
pgdata: {}
botlogs: {}