forked from fabriziosalmi/certmate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (99 loc) · 3.53 KB
/
Copy pathdocker-compose.yml
File metadata and controls
102 lines (99 loc) · 3.53 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
services:
certmate:
build:
context: .
args:
REQUIREMENTS_FILE: requirements.txt
# Optional extras layered on top of the main requirements.
# Accepts a SPACE-SEPARATED list of requirements files so one
# image can carry both DNS plugins and remote storage backends.
# Set in .env to bake them in at image build time, e.g.:
# EXTRA_REQUIREMENTS=requirements-azure.txt requirements-storage-all.txt
# EXTRA_REQUIREMENTS=requirements-storage-all.txt
# EXTRA_REQUIREMENTS=requirements-aws.txt requirements-gcp.txt
# Defaults to empty (skipped).
EXTRA_REQUIREMENTS: ${EXTRA_REQUIREMENTS:-}
# Uncomment to use pre-built multi-platform image instead of building locally:
# image: YOUR_DOCKERHUB_USERNAME/certmate:latest
# platform: linux/amd64 # Optional: force specific platform (linux/amd64, linux/arm64)
container_name: certmate
ports:
- "127.0.0.1:8000:8000" # Bind to localhost only; use nginx profile for external access
environment:
- FLASK_ENV=production
- SECRET_KEY=${SECRET_KEY:-} # Auto-generated if empty; set a strong value for production
# - SECRET_KEY_FILE=${SECRET_KEY_FILE:-} # Alternative: path to a file containing the secret key
- CLOUDFLARE_TOKEN=${CLOUDFLARE_TOKEN}
- API_BEARER_TOKEN=${API_BEARER_TOKEN:-} # Auto-generated if empty; set a strong value for production
#- API_BEARER_TOKEN_FILE=${API_BEARER_TOKEN_FILE:-} # Alternative: path to a file containing the bearer token
- BEHIND_PROXY=${BEHIND_PROXY:-false} # Set true when CertMate runs behind nginx or another trusted reverse proxy
- PORT=${PORT:-8000} # Internal listen port; also update ports: mapping if changed
- GUNICORN_TIMEOUT=${GUNICORN_TIMEOUT:-300} # Worker timeout; increase for slow DNS providers
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL:-} # Overrides the email set via the web UI when set
volumes:
- ./certificates:/app/certificates:rw
- ./logs:/app/logs:rw
- ./data:/app/data:rw
- ./backups:/app/backups:rw
restart: unless-stopped
cap_drop:
- ALL
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
reservations:
memory: 128M
healthcheck:
test: ["CMD", "sh", "-c", "curl -f http://localhost:${PORT:-8000}/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Optional: Add nginx reverse proxy
nginx:
image: nginx:alpine
container_name: certmate-nginx
ports:
- "80:80"
- "443:443"
volumes:
# Copy nginx.conf.example to nginx.conf and set your domain BEFORE `up`:
# a missing host file makes Docker create nginx.conf as an empty DIRECTORY.
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certificates:/etc/nginx/ssl:ro
depends_on:
certmate:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
restart: unless-stopped
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
profiles:
- nginx
networks:
default:
name: certmate_network