-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (56 loc) · 1.41 KB
/
docker-compose.yml
File metadata and controls
56 lines (56 loc) · 1.41 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
services:
traefik:
image: traefik:v3.0
container_name: traefik
command:
- "--api.dashboard=true"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080" # Traefik dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- traefik
db:
image: postgres:15-alpine
container_name: todo-db
environment:
POSTGRES_USER: todouser
POSTGRES_PASSWORD: todopass
POSTGRES_DB: tododb
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U todouser -d tododb"]
interval: 5s
timeout: 5s
retries: 5
app:
build: .
container_name: todo-app
environment:
DATABASE_URL: postgres://todouser:todopass@db:5432/tododb
depends_on:
db:
condition: service_healthy
volumes:
- ./server.js:/app/server.js
networks:
- traefik
- default
labels:
- "traefik.enable=true"
- "traefik.http.routers.todo-app.rule=Host(`docker-compose-sample.navegante.ext`)"
- "traefik.http.routers.todo-app.entrypoints=web"
- "traefik.http.services.todo-app.loadbalancer.server.port=3000"
networks:
traefik:
name: traefik
volumes:
postgres-data: