localspot/docker-compose.yml
Kevin Sivic 2025c87a8c
All checks were successful
CI - Test, Build, and Push / test (push) Successful in 2m45s
CI - Test, Build, and Push / build-and-push (push) Successful in 11s
Add docker-compose for production deployment
- Add docker-compose.yml with app and postgres services
- Add .env.example with required environment variables
- Add .env to .gitignore to prevent committing secrets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 14:03:20 -05:00

49 lines
1.3 KiB
YAML

# 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: