-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (96 loc) · 2.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
103 lines (96 loc) · 2.7 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
103
# Production Docker Compose configuration
# Usage: cp .env.example .env && docker compose up -d
services:
app:
build:
context: ./app
dockerfile: Dockerfile
container_name: cf-demo-app
restart: unless-stopped
expose:
- "8000"
environment:
- UMAMI_WEBSITE_ID=${UMAMI_WEBSITE_ID:-}
networks:
- cf-demo-network
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/')"]
interval: 30s
timeout: 10s
retries: 3
nginx:
image: nginx:alpine
container_name: cf-demo-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- DOMAIN=${DOMAIN:-localhost}
volumes:
- ./nginx/nginx.conf.template:/etc/nginx/nginx.conf.template:ro
- ./nginx/docker-entrypoint.sh:/docker-entrypoint.sh:ro
- ./nginx/snippets:/etc/nginx/snippets:ro
- ./cloudflare:/etc/nginx/cloudflare:ro
- ./certbot/www:/var/www/certbot:ro
depends_on:
- app
- umami
networks:
- cf-demo-network
entrypoint: ["/docker-entrypoint.sh"]
command: ["/bin/sh", "-c", "while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g 'daemon off;'"]
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
container_name: cf-demo-umami
restart: unless-stopped
expose:
- "3000"
environment:
DATABASE_URL: postgresql://umami:${UMAMI_DB_PASSWORD:-umami_secret}@umami-db:5432/umami
APP_SECRET: ${UMAMI_APP_SECRET:-replace_me_with_random_string}
depends_on:
umami-db:
condition: service_healthy
networks:
- cf-demo-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/heartbeat"]
interval: 30s
timeout: 10s
retries: 3
umami-db:
image: postgres:16-alpine
container_name: cf-demo-umami-db
restart: unless-stopped
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: ${UMAMI_DB_PASSWORD:-umami_secret}
volumes:
- umami-db-data:/var/lib/postgresql/data
networks:
- cf-demo-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U umami"]
interval: 10s
timeout: 5s
retries: 5
certbot:
build:
context: ./certbot
dockerfile: Dockerfile
container_name: cf-demo-certbot
environment:
- DOMAIN=${DOMAIN:-localhost}
- LE_EMAIL=${LE_EMAIL:-admin@example.com}
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
networks:
- cf-demo-network
volumes:
umami-db-data:
networks:
cf-demo-network:
driver: bridge