wiki_ghostguild/docker-compose.yml
Jennie Robinson Faber 83c987bb71 Bake cron scripts into the image instead of bind-mounting them
DokPloy's redeploy process rm -rf's the host code dir and recreates it.
The cron container is `restart: unless-stopped` so docker-compose
doesn't recreate it when only scripts/* change — but its bind mount on
./scripts:/app/scripts then points at orphaned inodes inside the
running container, leaving /app/scripts empty until someone manually
`docker restart`s it.

Bake the scripts into the image instead. A scripts/* change now forces
a Dockerfile rebuild → docker-compose recreates the cron service →
fresh /app/scripts inside, no manual restart required. content/ and
.git/ stay bind-mounted because the export job needs to write commits
the host can see.

Also adds .dockerignore so the host's scripts/node_modules (potentially
darwin-specific) doesn't get COPY'd into the alpine image and shadow
the deps installed by `npm install` at build time.
2026-04-08 12:06:04 +01:00

106 lines
2.4 KiB
YAML

services:
nginx:
image: nginx:alpine
restart: unless-stopped
depends_on:
- outline
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- default
- dokploy-network
outline:
image: docker.getoutline.com/outlinewiki/outline:1.6.1
restart: unless-stopped
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- outline-storage:/var/lib/outline/data
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: outline
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: outline
volumes:
- postgres-data:/var/lib/postgresql/data
command:
- "postgres"
- "-c"
- "shared_buffers=128MB"
- "-c"
- "max_connections=20"
- "-c"
- "work_mem=4MB"
- "-c"
- "maintenance_work_mem=64MB"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U outline"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
cron:
build:
context: .
dockerfile: cron/Dockerfile
restart: unless-stopped
depends_on:
- postgres
volumes:
# NOTE: scripts/ is intentionally NOT bind-mounted — it's baked into
# the cron image (see cron/Dockerfile) so DokPloy redeploys can't
# orphan it. content/ and .git/ stay mounted because the export job
# writes commits the host needs to see.
- ./content:/app/content
- ./.git:/app/.git
- /var/run/docker.sock:/var/run/docker.sock:ro
# Absolute path required: DokPloy does NOT expand ~ and would otherwise
# create a literal "~" directory under the deployment dir.
- /root/.ssh:/root/.ssh:ro
- ./backups:/backups/outline
env_file:
- .env
networks:
dokploy-network:
external: true
volumes:
outline-storage:
name: code_outline-storage
external: true
postgres-data:
name: code_postgres-data
external: true
redis-data:
name: code_redis-data
external: true