forked from falkr/reflect-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
69 lines (69 loc) · 2.11 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
version: "3.3"
services:
traefik:
image: "traefik:v2.6"
command:
#- "--log.level=DEBUG"
- "--api.insecure=false"
- "--providers.docker=false"
- "--providers.docker.exposedbydefault=false"
#- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443" # new
ports:
- "80:80"
- "443:443"
volumes:
- "./traefik.yaml:/etc/traefik/traefik.yaml"
- "./certs/:/certs/"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
db:
image: postgres:latest
volumes:
- ./db-data:/var/lib/postgresql/data/pgdata
env_file:
- ./backend/.env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
frontend:
image:
reflect-frontend
# network_mode: "host"
build:
context: ./frontend
dockerfile:
Dockerfile
# ports:
# - 5173:3000
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`reflect.iik.ntnu.no`)"
- "traefik.http.routers.frontend.tls=true"
- "traefik.http.routers.frontend.entrypoints=websecure"
- "traefik.http.middlewares.frontend.redirectscheme.scheme=websecure"
- "traefik.http.middlewares.frontend.redirectscheme.permanent=true"
- "traefik.port=3000"
backend:
image: reflect
#network_mode: "host"
command: ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "80", "--reload", "--root-path", "/api"]
build:
context: ./backend
dockerfile:
Dockerfile
volumes:
- ./backend:/backend/
ports:
- 8000:80
env_file:
- ./backend/.env
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`reflect.iik.ntnu.no`) && PathPrefix(`/api`) || Host(`reflect.iik.ntnu.no`) && PathPrefix(`/auth`) "
- "traefik.http.routers.backend.tls=true"
- "traefik.http.routers.backend.entrypoints=websecure"
- "traefik.http.middlewares.backend-strip.stripprefix.prefixes=/api"
- "traefik.http.routers.backend.middlewares=backend-strip"
- "traefik.port=80"
depends_on:
- db
restart: always