-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.stack.dev.yml
84 lines (81 loc) · 2.64 KB
/
docker-compose.stack.dev.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
version: '3.7'
services:
proxy:
image: traefik:v2.10
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:
- "--providers.docker"
- "--providers.docker.watch"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.constraints=Label(`traefik.tags`, `${TRAEFIK_TAG}`)"
- "--entrypoints.http.address=:80"
- "--log.level=DEBUG"
- "--accessLog"
- "--api.dashboard=true"
labels:
- "traefik.http.services.dashboard.loadbalancer.server.port=8080"
- "traefik.http.routers.dashboard.rule=Host(`traefik.${DOMAIN}`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.tags=${TRAEFIK_TAG}"
- "traefik.enable=true"
ports:
# Traefik handles http
- "80:80"
frontend:
build:
context: ./frontend
dockerfile: dev.dockerfile
target: dev-runner
labels:
- "traefik.http.services.corgi-frontend.loadbalancer.server.port=80"
- "traefik.http.routers.corgi-frontend.rule=PathPrefix(`/`)"
- "traefik.http.routers.corgi-frontend.entrypoints=http"
- "traefik.tags=${TRAEFIK_TAG}"
- "traefik.enable=true"
volumes:
- ./frontend:/app
ports:
# This is for the live reloading (maybe add to traefik as a tcp service?)
- '35729:35729'
backend:
build:
context: ./backend
dockerfile: backend.dockerfile
target: dev-runner
volumes:
- ./backend/app:/app
environment: &testenv
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_SERVER=${POSTGRES_SERVER:-db}
- POSTGRES_DB=${POSTGRES_DB:-corgi_dev}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust}
- REVISION=${REVISION}
- TAG=${TAG}
- STACK_NAME=${STACK_NAME}
- DEPLOYED_AT=${DEPLOYED_AT}
- BACKEND_CORS_ORIGINS=http://localhost, http://localhost:3000
labels:
- "traefik.http.services.corgi-backend.loadbalancer.server.port=80"
- "traefik.http.routers.corgi-backend.rule=PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`) || PathPrefix(`/openapi.json`)"
- "traefik.http.routers.corgi-backend.entrypoints=http"
- "traefik.tags=${TRAEFIK_TAG}"
- "traefik.enable=true"
command: ./bin/prestart-dev.sh
networks:
default:
aliases:
- ${DOMAIN}
db:
image: postgres:12
environment: *testenv
docs:
build:
context: ./docs
ports:
- '8000:8000'
volumes:
- ./docs:/docs
- .:/corgi