-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.override.yml
86 lines (78 loc) · 2.67 KB
/
docker-compose.override.yml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
services:
proxy:
image: traefik:3
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "80:80"
- "8090:8080"
# Duplicate the command from docker-compose.yml to add --api.insecure=true
command:
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker
# Add a constraint to only use services with the label for this stack
- --providers.docker.constraints=Label(`traefik.constraint-label`, `traefik-public`)
# Do not expose all Docker services, only the ones explicitly exposed
- --providers.docker.exposedbydefault=false
# Create an entrypoint "http" listening on port 80
- --entrypoints.http.address=:80
# Enable the access log, with HTTP requests
- --accesslog
# Enable the Traefik log, for configurations and errors
- --log
# Enable debug logging for local development
- --log.level=DEBUG
# Enable the Dashboard and API
- --api
# Enable the Dashboard and API in insecure mode for local development
- --api.insecure=true
labels:
# Enable Traefik for this service, to make it available in the public network
- traefik.enable=true
- traefik.constraint-label=traefik-public
networks:
- traefik-public
- default
backend:
image: backend:dev
restart: no
ports:
- "8000:8000"
networks:
- traefik-public
- default
build:
context: ./backend
container_name: scanue-v-backend
depends_on:
- db
- valkey
env_file:
- .env
environment:
- POSTGRES_HOST=db
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
# HTTP entry point and rule
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=Host(`api.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.entrypoints=http
# Remove reference to HTTPS and its middlewares
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.middlewares=
# Clear HTTPS-specific labels
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.rule=
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.entrypoints=
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.tls.certresolver=
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.middlewares=
db:
restart: "no"
ports:
- "5432:5432"
valkey:
restart: "no"
ports:
- 6379:6379
networks:
traefik-public:
# For local dev, don't expect an external Traefik network
external: false