Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
67 lines (61 loc) · 2.36 KB
/
Copy pathcompose.yml
File metadata and controls
67 lines (61 loc) · 2.36 KB
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
services:
proxy:
image: traefik:v3.7
volumes:
# Host socket path comes from the current Docker context. The container target is Traefik's default endpoint.
- ${DOCKER_SOCKET:?Set DOCKER_SOCKET to the current Docker context socket path}:/var/run/docker.sock:ro
command:
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker
# Do not expose all Docker services, only the ones explicitly exposed
- --providers.docker.exposedbydefault=false
# Create an entrypoint "http" listening on port 80
- --entrypoints.http.address=:80
# Enable the access log, with HTTP requests
- --accesslog
# Enable the Traefik log, for configurations and errors
- --log
backend:
image: backend:latest
environment:
PROJECT_NAME: ${PROJECT_NAME:?Variable not set}
FRONTEND_HOST: ${FRONTEND_HOST:?Variable not set}
WORKOS_CLIENT_ID: ${WORKOS_CLIENT_ID:?Variable not set}
WORKOS_ISSUER: ${WORKOS_ISSUER:?Variable not set}
WORKOS_JWKS_URL: ${WORKOS_JWKS_URL:?Variable not set}
WORKOS_API_HOSTNAME: ${WORKOS_API_HOSTNAME:?Variable not set}
SMTP_HOST: ${SMTP_HOST:-}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
EMAILS_FROM_EMAIL: ${EMAILS_FROM_EMAIL:-}
DATABASE_URL: ${DATABASE_URL:?Explicit non-superuser NOBYPASSRLS runtime URL required}
SENTRY_DSN: ${SENTRY_DSN:-}
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"http://localhost:8000/api/v1/utils/health-check/",
]
interval: 10s
timeout: 5s
retries: 5
build:
context: .
dockerfile: backend/Dockerfile
labels:
# Enable Traefik for this service
- traefik.enable=true
# Define the port inside of the Docker service to use
- traefik.http.services.backend.loadbalancer.server.port=8000
# Route HTTP traffic for this domain
- traefik.http.routers.backend-http.rule=Host(`${DOMAIN:-localhost}`)
- traefik.http.routers.backend-http.entrypoints=http
migrate:
image: backend:latest
profiles: ["maintenance"]
command: ["bash", "scripts/prestart.sh"]
environment:
DATABASE_URL: ${DATABASE_URL:?Runtime URL required to verify distinct authorities}
API_MIGRATION_DATABASE_URL: ${API_MIGRATION_DATABASE_URL:-}