-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Expand file tree
/
Copy pathcompose.yml
More file actions
88 lines (79 loc) · 2.78 KB
/
Copy pathcompose.yml
File metadata and controls
88 lines (79 loc) · 2.78 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
services:
proxy:
image: traefik:3.6
volumes:
# Add Docker as a mounted volume, so that Traefik can read the labels of other services
- /var/run/docker.sock:/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
db:
image: postgres:18
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d app"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
volumes:
- app-db-data:/var/lib/postgresql
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?Variable not set}
- POSTGRES_DB=app
adminer:
image: adminer
depends_on:
- db
environment:
- ADMINER_DESIGN=pepa-linha-dark
labels:
# Enable Traefik for this service
- traefik.enable=true
# Route HTTP traffic for the Adminer subdomain
- traefik.http.routers.adminer-http.rule=Host(`adminer.${DOMAIN:-localhost}`)
- traefik.http.routers.adminer-http.entrypoints=http
# Define the port inside of the Docker service to use
- traefik.http.services.adminer.loadbalancer.server.port=8080
backend:
image: backend:latest
depends_on:
db:
condition: service_healthy
restart: true
environment:
PROJECT_NAME: ${PROJECT_NAME:?Variable not set}
SECRET_KEY: ${SECRET_KEY:?Variable not set}
FIRST_SUPERUSER: ${FIRST_SUPERUSER:?Variable not set}
FIRST_SUPERUSER_PASSWORD: ${FIRST_SUPERUSER_PASSWORD:?Variable not set}
SMTP_HOST: ${SMTP_HOST}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
EMAILS_FROM_EMAIL: ${EMAILS_FROM_EMAIL}
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:?Variable not set}@db:5432/app
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
volumes:
app-db-data: