-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
67 lines (64 loc) · 2.88 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
version: "3.8"
x-logging: &default-logging
options:
max-size: "10m"
max-file: "2"
driver: json-file
# Debug config with docker-compose --env-file <...> config
services:
backend:
image: ${PROJECT_PREFIX:?not set}-${APP_ENV:?not set}-backend:latest
container_name: backend_${PROJECT_PREFIX}_${APP_ENV}
networks:
- traefik-net
command:
- "--env=.env.${APP_ENV}"
volumes:
- ${PWD}/.env.${APP_ENV}:/.env.${APP_ENV}:ro
# required since mock server will use these
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro
build:
context: .
dockerfile: Dockerfile
args:
- "DOCKER_UID=${DOCKER_UID:?not set}"
- "DOCKER_GID=${DOCKER_GID:?not set}"
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
- "authserver.local.localhost:host-gateway" # required if running locally
labels:
- traefik.enable=true
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-backend.rule=Host(`${DOMAIN:?not set}`) && PathPrefix("${REVERSE_PROXY_API_PREFIX:?not set}")
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-backend.middlewares=${PROJECT_PREFIX}-stripprefix-backend,${PROJECT_PREFIX}-compress # check docs to exclude requests from compression
- traefik.http.middlewares.${PROJECT_PREFIX}-compress.compress=true
- traefik.http.middlewares.${PROJECT_PREFIX}-stripprefix-backend.stripprefix.prefixes=${REVERSE_PROXY_API_PREFIX:?not set}
- traefik.docker.network=traefik-net
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-backend.entrypoints=websecure
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-backend.tls=true
- traefik.http.services.${PROJECT_PREFIX}-${APP_ENV}-backend.loadbalancer.server.port=${API_PORT:?not set}
logging: *default-logging
frontend:
image: ${PROJECT_PREFIX:?not set}-${APP_ENV}-frontend:latest
container_name: frontend_${PROJECT_PREFIX}_${APP_ENV}
networks:
- traefik-net
build:
context: . # need complete context to follow symlinks, if any
dockerfile: frontend/Dockerfile
env_file: .env.${APP_ENV}
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-frontend.rule=Host(`${DOMAIN:?not set}`)
- traefik.docker.network=traefik-net
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-frontend.middlewares=${PROJECT_PREFIX}-compress
- traefik.http.middlewares.${PROJECT_PREFIX}-compress.compress=true
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-frontend.entrypoints=websecure
- traefik.http.routers.${PROJECT_PREFIX}-${APP_ENV}-frontend.tls=true
- traefik.http.services.${PROJECT_PREFIX}-${APP_ENV}-frontend.loadbalancer.server.port=${FRONTEND_PORT:?not set}
logging: *default-logging
networks:
traefik-net:
name: traefik-net
external: true