localspot/docker-compose.yml

50 lines
1.3 KiB
YAML
Raw Permalink Normal View History

# Docker Compose configuration for LocalSpot production deployment
#
# Usage:
# 1. Copy .env.example to .env and configure your settings
# 2. Run: docker compose up -d
#
# For first-time setup, run migrations:
# docker compose exec localspot /app/bin/migrate
services:
localspot:
image: forgejo.sivic.me/kevinsivic/localspot:latest
# Or build locally:
# build: .
restart: unless-stopped
ports:
- "4000:4000"
environment:
- DATABASE_URL=${DATABASE_URL:-postgres://postgres:postgres@db:5432/localspot}
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
- PHX_HOST=${PHX_HOST:-localhost}
- PORT=4000
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:16-alpine
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-localspot}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data: