Files
AFFiNE/docker-compose.gitea.yml
2026-08-25 22:01:15 +07:00

61 lines
1.6 KiB
YAML

# AFFiNE self-hosted — image built from Dockerfile.all-in-one (MCP 1.1.0)
#
# Usage:
# docker compose up -d
# open http://localhost:3010
services:
affine:
image: gitea.luulam.dev/luulam/affine:latest
restart: unless-stopped
ports:
- '3010:3010'
# Image entrypoint does not run migrations; do it once on first boot
command: >
sh -c "node node_modules/prisma/build/index.js migrate deploy &&
node ./dist/main.js"
environment:
# All-in-one flavor runs sync + graphql + front in one process
- FLAVOR=allinone
- DATABASE_URL=postgresql://affine:affine@postgres:5432/affine
- REDIS_SERVER_HOST=redis
- REDIS_SERVER_PORT=6379
# Signer for auth tokens (auth) — change in production!
- AFFINE_SECRET=change-me-to-a-random-string
# Blob storage on local disk
- AFFINE_STORAGE_LOCAL=true
volumes:
- affine-storage:/app/storage
- affine-config:/app/config
postgres:
image: postgres:16
restart: unless-stopped
environment:
- POSTGRES_USER=affine
- POSTGRES_PASSWORD=affine
- POSTGRES_DB=affine
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U affine -d affine']
interval: 5s
timeout: 3s
retries: 20
redis:
image: redis:7
restart: unless-stopped
volumes:
- redis-data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 20
volumes:
postgres-data:
redis-data:
affine-storage:
affine-config: