-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
60 lines (59 loc) · 1.52 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
53
54
55
56
57
58
59
60
services:
postgres:
image: postgres:15
container_name: postgres
env_file: .env
healthcheck:
test: [ CMD, pg_isready, -U, $POSTGRES_USER, -d, $POSTGRES_DB ]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s
volumes:
- postgres-data:/var/lib/postgresql/data
- postgres-logs:/var/lib/postgresql/pg_log
ports:
- 5432:5432
migrate:
build:
context: database
container_name: migrate
environment:
DATABASE_URL: postgresql://$POSTGRES_USER:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/$POSTGRES_DB
command: [ cargo, sqlx, migrate, run ]
depends_on:
postgres:
condition: service_healthy
backend:
image: rust:1.83
container_name: backend
environment:
DATABASE_URL: postgresql://$POSTGRES_USER:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/$POSTGRES_DB
working_dir: /app
command: [ cargo, run ]
depends_on:
migrate:
condition: service_completed_successfully
ports:
- 8080:8080
volumes:
- ./backend:/app
# frontend:
# cli:
# desktop:
# TODO fix dummy data script
# dummy_data:
# image: postgres:15
# container_name: dummy_data
# working_dir: /data
# env_file: .env
# environment:
# PGPASSWORD: $POSTGRES_PASSWORD
# volumes:
# - ./shared/models/tests/data:/data
# command: [ psql, -h, $POSTGRES_HOST, -U, $POSTGRES_USER, -d, $POSTGRES_DB, -f, dummy.sql]
# depends_on:
# - migrate
volumes:
postgres-data:
postgres-logs: