-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yaml
110 lines (102 loc) · 2.85 KB
/
docker-compose.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
version: "2"
networks:
default:
external:
name: "web"
services:
whotraefik:
image: "traefik:v2.6"
container_name: "whotraefik"
ports:
- "80:80"
- "8080:8080"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
whofrontend:
build:
context: "."
dockerfile: "./.docker/frontend/Dockerfile"
container_name: "whofrontend"
volumes:
- ./frontend:/app
environment:
- "API_BASEURI=http://api.whoowesme.local"
- "APP_PORT=8000"
ports:
- "8000"
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.http.routers.whofrontend.rule=Host(`whoowesme.local`)"
- "traefik.http.services.whofrontend.loadBalancer.server.port=8000"
- "traefik.http.routers.whofrontend.entrypoints=web"
command: "npm run dev"
tty: true
whoapi:
container_name: "whoapi"
build:
context: "."
dockerfile: "./.docker/backend/Dockerfile"
volumes:
- './backend:/app'
ports:
- "5001"
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.http.routers.whobackend.rule=Host(`api.whoowesme.local`)"
- "traefik.http.services.whobackend.loadBalancer.server.port=5001"
- "traefik.http.routers.whobackend.entrypoints=web"
# Service Loadbalancer configs
# Healthcheck
# - "traefik.http.services.whobackend.loadBalancer.healthcheck.path=/health"
# - "traefik.http.services.whobackend.loadBalancer.healthcheck.interval=60s"
# - "traefik.http.services.whobackend.loadBalancer.healthcheck.timeout=10s"
command: "npm run start:dev"
tty: true
environment:
POSTGRES_HOST: "whodb"
POSTGRES_PORT: 5432
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "db_whoowesme"
FRONTEND_ORIGIN: "*"
JWT_TOKEN_EXPIRES: "3h"
JWT_SECRETS: "MySecretJWT"
whodb:
image: "postgres:12.3"
container_name: "whodb"
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_DB: "db_whoowesme"
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
volumes:
- "whodata:/var/lib/postgres/data"
whodbtest:
image: "postgres:12.3"
container_name: "whodbtest"
ports:
- "5423:5432"
environment:
POSTGRES_PASSWORD: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_DB: "db_whoowesmetest"
# labels:
# - "traefik.enable=true"
# - "traefik.docker.network=web"
# volumes:
# - "whodata:/var/lib/postgres/data"
volumes:
whodata:
external: true