-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
60 lines (56 loc) · 1.47 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
60 lines (56 loc) · 1.47 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
services:
app:
container_name: uranium
build:
context: .
dockerfile: docker/${ENVIRONMENT}/Dockerfile
args:
- CARGO_TARGET_DIR=/cargo-target
ports:
- ${PORT}:${PORT}
environment:
PORT: 5006
ENVIRONMENT: dev
DATABASE_NAME: uranium
DATABASE_USER: uranium
DATABASE_PASSWORD: uranium
DATABASE_PORT: 5432
DATABASE_HOST: postgres
DATABASE_URL: postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
JWT_SIGNING_KEY: fXUuojVKfWgVi3qLgQl8GjPWHsihf33aExhi
# env_file:
# - .env.local
depends_on:
database:
condition: service_started
networks:
- internal
volumes:
- .:/app:cached
- cargo-target:/cargo-target:delegated
- rust-cache:/usr/local/cargo/registry:delegated
command: cargo watch -qcx run
stdin_open: true
tty: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${PORT}/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s # Wait 30 seconds before starting health checks
database:
image: postgres:15-alpine
restart: always
container_name: postgres
environment:
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
networks:
- internal
networks:
internal:
name: uranium-network
volumes:
cargo-target:
rust-cache: