-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (55 loc) · 1.5 KB
/
docker-compose.yml
File metadata and controls
59 lines (55 loc) · 1.5 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
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "${HOST_PORT:-80}:80"
- "${HOST_PORT_TRPC:-2022}:2022"
environment:
- APP_DATABASE_URL=${APP_DATABASE_URL:-postgres://postgres:postgres@postgres:5432/postgres}
container_name: ${BACKEND_CONTAINER_NAME:-app}
depends_on:
db-push:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:2022/healthcheck"]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
db-push:
build:
context: .
dockerfile: Dockerfile
container_name: ${DB_PUSH_CONTAINER_NAME:-app-db-push}
command: ["bun", "run", "drizzle-kit", "push", "--force"]
working_dir: /app/server
environment:
- APP_DATABASE_URL=${APP_DATABASE_URL:-postgres://postgres:postgres@postgres:5432/postgres}
depends_on:
postgres:
condition: service_healthy
postgres:
container_name: ${POSTGRES_CONTAINER_NAME:-postgres}
image: postgres:17-alpine3.21
hostname: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- default
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 1s
timeout: 20s
retries: 5
volumes:
postgres_data:
networks:
default:
name: ${NETWORK_NAME:-app_network}
driver: bridge