-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
86 lines (80 loc) · 2.26 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
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
version: "3.8"
services:
traefik:
image: "traefik:v2.6"
container_name: "traefik"
command:
- "--log.level=DEBUG"
# - "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
labels:
- "traefik.docker.network=traefik"
networks:
traefik:
# === DEVELOPMENT ONLY === #
whoami:
image: "traefik/whoami"
container_name: "whoami"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`localhost`) && PathPrefix(`/whoami/`)"
- "traefik.http.middlewares.whoami-prefix.stripprefix.prefixes=/whoami"
- "traefik.http.routers.whoami.middlewares=whoami-prefix@docker"
- "traefik.http.routers.whoami.entrypoints=web"
networks:
traefik:
api:
build: api
container_name: api
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`localhost`) && PathPrefix(`/api/`)"
- "traefik.http.middlewares.api-prefix.stripprefix.prefixes=/api"
- "traefik.http.routers.api.middlewares=api-prefix@docker"
- "traefik.http.routers.api.service=api-port@docker"
- "traefik.http.services.api-port.loadbalancer.server.port=8000"
- "traefik.http.routers.api.entrypoints=web"
volumes:
- "./api:/usr/api"
- "./data:/usr/data"
- "./config.json:/usr/api/config.json"
depends_on:
- traefik
- pgres
networks:
traefik:
ui:
build:
target: deps
context: ui
container_name: ui
volumes:
- ./ui:/app
labels:
- "traefik.enable=true"
- "traefik.http.routers.ui.rule=Host(`localhost`)"
- "traefik.http.routers.service=ui-port@docker"
- "traefik.http.services.ui-port.loadbalancer.server.port=3000"
- "traefik.http.routers.ui.entrypoints=web"
networks:
traefik:
pgres:
image: postgres:10.4
container_name: pgres
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_DB=${DB_NAME}
volumes:
- ./db:/var/lib/postgresql/data
networks:
traefik:
networks:
traefik: