-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
49 lines (47 loc) · 1.35 KB
/
docker-compose.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
version: "3.9"
services:
blueprint:
image: ${CONTAINER_REGISTRY_PATH}/blueprint:latest
deploy:
mode: replicated
replicas: 2
restart_policy:
condition: on-failure
delay: 10s
resources:
# Hard limit
limits:
cpus: "2"
memory: 256M
# Soft limit
reservations:
cpus: "0.5"
memory: 50M
labels:
- "traefik.http.routers.blueprint.rule=Host(`${SERVICE_HOST}`) && PathPrefix(`/blueprint`)"
- "traefik.http.services.blueprint.loadbalancer.server.port=5000"
- "traefik.http.middlewares.blueprint-stripprefix.stripprefix.prefixes=/blueprint, /blueprint/"
- "traefik.http.routers.blueprint.middlewares=blueprint-stripprefix"
command: ["uvicorn", "main:app", "--root-path", "/blueprint", "--host", "0.0.0.0", "--port", "5000", "--proxy-headers"]
environment:
# Redis configs
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_PASS: ${REDIS_PASS}
REDIS_DB: ${REDIS_DB}
# Database configs
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
networks:
- traefik-net
- redis-net
networks:
traefik-net:
driver: overlay
external: true
redis-net:
driver: overlay
external: true