aboutsummaryrefslogtreecommitdiffstats
path: root/compose.yml
diff options
context:
space:
mode:
Diffstat (limited to 'compose.yml')
-rw-r--r--compose.yml33
1 files changed, 33 insertions, 0 deletions
diff --git a/compose.yml b/compose.yml
new file mode 100644
index 0000000..4aa1dd3
--- /dev/null
+++ b/compose.yml
@@ -0,0 +1,33 @@
+# Production-style deployment: app + Postgres. Put a reverse proxy (nginx, caddy)
+# in front of 127.0.0.1:8080 that forwards example.com and *.example.com with
+# the original Host header. Configure via .env (see .env.example).
+services:
+ app:
+ build: .
+ restart: unless-stopped
+ env_file: .env
+ environment:
+ DATABASE_URL: postgres://blogspace:${POSTGRES_PASSWORD:-blogspace}@db:5432/blogspace?sslmode=disable
+ ports:
+ - "127.0.0.1:${APP_PORT:-8080}:8080"
+ depends_on:
+ db:
+ condition: service_healthy
+
+ db:
+ image: postgres:17-alpine
+ restart: unless-stopped
+ environment:
+ POSTGRES_USER: blogspace
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-blogspace}
+ POSTGRES_DB: blogspace
+ volumes:
+ - pgdata:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U blogspace"]
+ interval: 5s
+ timeout: 3s
+ retries: 20
+
+volumes:
+ pgdata: