-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
61 lines (58 loc) · 2.61 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
61 lines (58 loc) · 2.61 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
# ─────────────────────────────────────────────────────────────────────────────
# OpenBlog — production compose (pulls pre-built image)
# ─────────────────────────────────────────────────────────────────────────────
# This is the file to ship. Users download ONLY this file (and create their
# own .env) — no repo clone, no build step.
#
# Image source:
# OPENBLOG_IMAGE default: ghcr.io/iamcoder18/openblog:latest
# pin to a version (e.g. :v0.1.0) for production
#
# To build from source instead, use docker-compose.local.yaml:
# docker compose -f docker-compose.local.yaml up -d --build
#
# Host port mapping (override in .env if you have conflicts):
# APP_HOST_PORT default: 3000
# POSTGRES_HOST_PORT default: 5432
#
# Reads `.env` from the project root automatically.
# ─────────────────────────────────────────────────────────────────────────────
services:
postgres:
image: postgres:16-alpine
container_name: openblog-db
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: openblog
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_HOST_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
app:
image: ${OPENBLOG_IMAGE:-ghcr.io/iamcoder18/openblog:latest}
container_name: openblog-app
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ports:
- "${APP_HOST_PORT:-3000}:3000"
environment:
# Runtime config — these override anything baked into the image.
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/openblog?schema=public
BASE_URL: ${BASE_URL:?BASE_URL must be set (e.g. http://localhost:3000 or https://blog.example.com)}
BLOG_NAME: ${BLOG_NAME:-OpenBlog}
NODE_ENV: production
PORT: 3000
# Injected at container start. Never bake into the image.
AUTH_SECRET: ${AUTH_SECRET:?AUTH_SECRET must be set (generate with `openssl rand -base64 32`)}
SIGN_UP_ENABLED: ${SIGN_UP_ENABLED:-false}
volumes:
postgres_data: