Initial Commit: Status Testing
This commit is contained in:
1 parent
1eff675f05
commit
42dd1f2d4a
286 files changed
+64800
-369
No files matched your search
@@ -0,0 +1,88 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#
|
||||
# Eine Surveybox-Instanz. Für eine zweite Instanz auf demselben Host das
|
||||
# Verzeichnis kopieren und eine eigene .env anlegen (anderer Projektname,
|
||||
# anderer Port). Instanzen teilen nichts.
|
||||
#
|
||||
# Externe Datenbank: in der .env COMPOSE_PROFILES leer lassen und die
|
||||
# Verbindungsdaten eintragen. Der Dienst "db" startet dann nicht.
|
||||
#
|
||||
# Netz: Das Subnetz des Stacks steht fest in der .env (SURVEYBOX_NET_SUBNET),
|
||||
# damit Docker sich nicht selbst einen Bereich nimmt, der mit dem LAN, einem
|
||||
# VPN oder anderen Stacks kollidiert. Jede Instanz braucht ein eigenes Subnetz.
|
||||
|
||||
name: ${COMPOSE_PROJECT_NAME:-surveybox}
|
||||
|
||||
x-app: &app
|
||||
image: ${SURVEYBOX_IMAGE:-surveybox:local}
|
||||
build: .
|
||||
env_file: ${SURVEYBOX_ENV_FILE:-.env}
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=64m,mode=1777
|
||||
cap_drop: [ALL]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
volumes:
|
||||
- data:/data
|
||||
stop_grace_period: 30s
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:18-alpine
|
||||
profiles: [db]
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${SURVEYBOX_DB_NAME:-surveybox}
|
||||
POSTGRES_USER: ${SURVEYBOX_DB_USER:-surveybox}
|
||||
POSTGRES_PASSWORD: ${SURVEYBOX_DB_PASSWORD:?SURVEYBOX_DB_PASSWORD fehlt in der .env}
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --data-checksums"
|
||||
volumes:
|
||||
# Ab PostgreSQL 18 wird /var/lib/postgresql eingebunden, nicht .../data.
|
||||
- pgdata:/var/lib/postgresql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
|
||||
web:
|
||||
<<: *app
|
||||
command: ["web"]
|
||||
ports:
|
||||
- "${SURVEYBOX_HTTP_BIND:-127.0.0.1}:${SURVEYBOX_HTTP_PORT:-8000}:8000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
required: false
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-m", "surveybox.cli", "healthcheck"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 300s
|
||||
|
||||
worker:
|
||||
<<: *app
|
||||
command: ["worker"]
|
||||
depends_on:
|
||||
web:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-m", "surveybox.cli", "healthcheck", "--worker"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 120s
|
||||
|
||||
networks:
|
||||
default:
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: ${SURVEYBOX_NET_SUBNET:?SURVEYBOX_NET_SUBNET fehlt in der .env}
|
||||
|
||||
volumes:
|
||||
data:
|
||||
pgdata:
|
||||
Reference in new issue
Block a user