voxblog/docker-compose.yml
Ender d8c41cc206
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
docs: add comprehensive local Docker testing guide
- Created new LOCAL_TESTING.md with detailed instructions for setting up local development environment
- Added step-by-step setup guide covering Docker installation, environment configuration, and common commands
- Included troubleshooting section with solutions for common issues like port conflicts and build failures
- Added development workflow guidelines and testing checklist for quality assurance
- Documented performance tips and best practices for Docker
2025-10-25 23:42:24 +02:00

76 lines
1.8 KiB
YAML

version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: voxblog-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: voxblog
MYSQL_USER: voxblog
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- voxblog-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
api:
build:
context: .
dockerfile: docker/api.Dockerfile
args:
PNPM_FLAGS: --no-frozen-lockfile
container_name: voxblog-api
restart: unless-stopped
ports:
- "127.0.0.1:3001:3001" # Only localhost, not internet
environment:
NODE_ENV: production
PORT: 3001
DATABASE_URL: mysql://voxblog:${MYSQL_PASSWORD}@mysql:3306/voxblog
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
OPENAI_API_KEY: ${OPENAI_API_KEY}
GHOST_ADMIN_API_KEY: ${GHOST_ADMIN_API_KEY}
S3_BUCKET: ${S3_BUCKET}
S3_REGION: ${S3_REGION}
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_ENDPOINT: ${S3_ENDPOINT}
depends_on:
mysql:
condition: service_healthy
networks:
- voxblog-network
volumes:
- ./data:/app/data
admin:
build:
context: .
dockerfile: docker/admin.Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-http://localhost:3001}
PNPM_FLAGS: --no-frozen-lockfile
container_name: voxblog-admin
restart: unless-stopped
ports:
- "127.0.0.1:3000:80" # Only localhost, not internet
networks:
- voxblog-network
depends_on:
- api
networks:
voxblog-network:
driver: bridge
volumes:
mysql_data: