-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
52 lines (47 loc) · 1.39 KB
/
docker-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
# This is a Docker Compose configuration for local use.
# In production use docker-compose.prod.yaml
# Run all services:
# docker compose up --build --detach
services:
bot:
build: # See bot.Dockerfile for more details
context: .
dockerfile: bot.Dockerfile
depends_on:
# Wait for the database to be ready before starting the application
db:
condition: service_healthy
# Wait for the Prisma migrate to apply migrations
prisma-migrate:
condition: service_completed_successfully
restart: always
env_file: .env.bot
prisma-migrate:
build: # See bot.Dockerfile for more details
context: .
dockerfile: bot.Dockerfile
depends_on:
db:
# Wait for the database to be ready before starting the application
condition: service_healthy
restart: no
env_file: .env.bot
command: pnpm run -C ./backend prisma:migrations:apply
db:
# See more: https://hub.docker.com/_/postgres
image: 'postgres:16.2'
restart: always
# The commits were slow on our servers, so we turned off the synchronous_commit
command: postgres -c synchronous_commit=off
volumes:
- 'postgres:/var/lib/postgresql/data'
ports:
- '5432:5432'
env_file: .env.db
healthcheck:
test: [CMD-SHELL, pg_isready -U postgres]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres: