-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (47 loc) · 1.51 KB
/
Copy pathdocker-compose.yml
File metadata and controls
50 lines (47 loc) · 1.51 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
services:
db:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_USER: openhosting
POSTGRES_PASSWORD: ${DB_PASSWORD:-openhosting}
POSTGRES_DB: openhosting
volumes:
# postgres 18+ images store data under /var/lib/postgresql/<major>/ —
# the volume must mount the parent, not the old …/data path.
- db-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U openhosting"]
interval: 5s
timeout: 3s
retries: 10
app:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgresql://openhosting:${DB_PASSWORD:-openhosting}@db:5432/openhosting
DIRECT_URL: postgresql://openhosting:${DB_PASSWORD:-openhosting}@db:5432/openhosting
CRON_SECRET: ${CRON_SECRET:-change-me}
# Only read by the seed, so re-seeding keeps the admin address chosen at
# install time instead of adding a second admin@example.com.
SEED_ADMIN_EMAIL: ${SEED_ADMIN_EMAIL:-}
ports:
- "${APP_PORT:-3000}:3000"
# Hits the billing endpoint hourly (renewal invoices, suspensions).
cron:
image: curlimages/curl:latest
restart: unless-stopped
depends_on:
- app
command: >
/bin/sh -c 'while true; do
sleep 3600;
curl -s -X POST -H "Authorization: Bearer $${CRON_SECRET}" http://app:3000/api/cron;
done'
environment:
CRON_SECRET: ${CRON_SECRET:-change-me}
volumes:
db-data: