-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (62 loc) · 1.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (62 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
60
61
62
63
64
65
66
67
68
69
70
71
services:
web:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: todo
ports:
- "5000:5000"
env_file:
- .env-docker
labels:
# Explicitly tell Traefik to expose this container
- "traefik.enable=true"
# The domain the service will respond to
- "traefik.http.routers.web.rule=Host(`localhost`) || Host(`127.0.0.1`)"
- "traefik.http.routers.web.entrypoints=web"
- "traefik.http.services.web.loadbalancer.server.port=5000"
networks:
- traefik
- db
depends_on:
todo-db:
condition: service_healthy
traefik:
condition: service_started
todo-db:
image: postgres:14
container_name: database
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
volumes: # Mount host paths or named volumes
- postgres_data:/var/lib/postgresql/data
networks:
- db
traefik:
image: traefik:v3.0
command: --configFile=/etc/traefik/traefik.yml
ports:
- "80:80"
- "8081:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- ./traefik.yml:/etc/traefik/traefik.yml
- "./logs:/var/log/traefik"
networks:
- traefik
networks:
traefik:
db:
volumes:
postgres_data: