Add Docker Compose configuration and environment files for local and production setups

- Created docker-compose.docker-local.yml for local testing of frontend and backend services.
- Added .env.development for development environment configuration.
- Introduced .env.docker-local for local Docker environment settings.
- Added .env.production for production environment configuration for Synology deployment.
This commit is contained in:
2026-01-30 11:29:17 -05:00
parent 4d14f9ba9c
commit fee8fe2551
30 changed files with 899 additions and 304 deletions

View File

@@ -0,0 +1,82 @@
# Pokedex.Online Local Docker Compose
# For testing production builds locally before deploying to Synology
# Frontend: http://localhost:8099
# Backend: http://localhost:3099
services:
# Frontend - Nginx serving built Vue.js app
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
container_name: pokedex-frontend-docker-local
ports:
- '8099:80'
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
networks:
- pokedex-network
healthcheck:
test:
[
'CMD',
'wget',
'--quiet',
'--tries=1',
'--spider',
'http://localhost:80/'
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Backend - Node.js API server
backend:
build:
context: ./server
dockerfile: Dockerfile
container_name: pokedex-backend-docker-local
ports:
- '3099:3000'
environment:
- DEPLOYMENT_TARGET=docker-local
- NODE_ENV=production
- PORT=3000
- FRONTEND_URL=http://localhost:8099
env_file:
- ./server/.env
volumes:
# Persist OAuth session data
- ./server/data:/app/data
# Persist logs
- ./server/logs:/app/logs
restart: unless-stopped
networks:
- pokedex-network
healthcheck:
test:
[
'CMD',
'wget',
'--quiet',
'--tries=1',
'--spider',
'http://localhost:3000/health'
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
pokedex-network:
driver: bridge
volumes:
backend-data:
driver: local
backend-logs:
driver: local