Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (65 loc) · 1.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
66 lines (65 loc) · 1.65 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
version: "3.8"
services:
postgres:
image: postgres:latest
container_name: rust-ddd-sample-postgres
ports:
- 5432:5432
volumes:
- rust-ddd-sample-postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
POSTGRES_DB: rust-ddd-sample
TZ: "Asia/Tokyo"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d agaroot_academy_for_biz -U postgres"]
interval: 5s
timeout: 5s
retries: 5
postgres_test:
image: postgres:latest
container_name: rust-ddd-sample-postgres-test
ports:
- 5433:5432
volumes:
- rust-ddd-sample-postgres-test-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
POSTGRES_DB: rust-ddd-sample
TZ: "Asia/Tokyo"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d agaroot_academy_for_biz -U postgres"]
interval: 5s
timeout: 5s
retries: 5
back-end:
build:
context: .
target: development
ports:
- 8080:8080
volumes:
- .:/app
- cargo_cache:/usr/local/cargo/registry
- target_cache:/app/target
environment:
TZ: "Asia/Tokyo"
depends_on:
postgres:
condition: service_healthy
postgres_test:
condition: service_healthy
healthcheck:
test: "curl -f http://localhost:8080/status || exit 1"
interval: 10s
timeout: 10s
retries: 5
start_period: 20s
command: /bin/sh -c "cargo watch -x fmt -x 'run --bin api'"
volumes:
cargo_cache:
target_cache:
rust-ddd-sample-postgres-data:
rust-ddd-sample-postgres-test-data: