-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.local.yaml
More file actions
55 lines (52 loc) · 2.21 KB
/
Copy pathdocker-compose.local.yaml
File metadata and controls
55 lines (52 loc) · 2.21 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
# ─────────────────────────────────────────────────────────────────────────────
# OpenBlog — local source build compose (developer workflow)
# ─────────────────────────────────────────────────────────────────────────────
# Identical to docker-compose.yaml but builds the image from the local
# Dockerfile instead of pulling from a registry.
#
# Use this when you're hacking on the codebase:
# docker compose -f docker-compose.local.yaml up -d --build
#
# To customize baked-in defaults (NEXT_PUBLIC_BLOG_NAME, etc.), edit the
# `ENV` block in Dockerfile before building.
# ─────────────────────────────────────────────────────────────────────────────
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:
build:
context: .
dockerfile: Dockerfile
image: openblog:local
container_name: openblog-app
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ports:
- "${APP_HOST_PORT:-3000}:3000"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/openblog?schema=public
BASE_URL: ${BASE_URL:-http://localhost:3000}
BLOG_NAME: ${BLOG_NAME:-OpenBlog}
NODE_ENV: production
PORT: 3000
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: