149 lines
4.8 KiB
YAML
149 lines
4.8 KiB
YAML
version: '3.8'
|
|
|
|
# =============================================================================
|
|
# Flashpoint Web - Docker Compose with Pre-built Images
|
|
# =============================================================================
|
|
#
|
|
# This configuration uses pre-built Docker images from Docker Hub
|
|
# instead of building locally. Much faster deployment!
|
|
#
|
|
# Usage:
|
|
# ------
|
|
# 1. Pull latest images:
|
|
# docker-compose -f docker-compose.images.yml pull
|
|
#
|
|
# 2. Start services:
|
|
# docker-compose -f docker-compose.images.yml up -d
|
|
#
|
|
# 3. View logs:
|
|
# docker-compose -f docker-compose.images.yml logs -f
|
|
#
|
|
# 4. Stop services:
|
|
# docker-compose -f docker-compose.images.yml down
|
|
#
|
|
# Note: Replace <dockerhub-username> with your Docker Hub username
|
|
# =============================================================================
|
|
|
|
services:
|
|
# Backend API Service
|
|
backend:
|
|
image: <dockerhub-username>/flashpoint-backend:latest
|
|
container_name: flashpoint-backend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${API_PORT:-3100}:3100"
|
|
volumes:
|
|
# Flashpoint data (read-only)
|
|
- ${FLASHPOINT_HOST_PATH:?FLASHPOINT_HOST_PATH environment variable must be set}:/data/flashpoint:ro
|
|
# User database (persistent)
|
|
- backend-db:/app/data
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-production}
|
|
- TZ=${TZ:-UTC}
|
|
- PORT=3100
|
|
- HOST=0.0.0.0
|
|
# Flashpoint base path (all other paths derived automatically by backend)
|
|
- FLASHPOINT_PATH=/data/flashpoint
|
|
# Game service URLs (Docker network)
|
|
- GAME_SERVICE_PROXY_URL=http://game-service:22500
|
|
- GAME_SERVICE_GAMEZIP_URL=http://game-service:22501
|
|
# External services
|
|
- EXTERNAL_IMAGE_URLS=${EXTERNAL_IMAGE_URLS:-https://infinity.flashpointarchive.org/Flashpoint/Data/Images,https://infinity.unstable.life/Flashpoint/Data/Images}
|
|
- DOMAIN=${DOMAIN:-http://localhost:${WEB_PORT:-80}}
|
|
# Application settings
|
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
|
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET environment variable must be set}
|
|
- USER_DB_PATH=/app/data/user.db
|
|
depends_on:
|
|
game-service:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "--fail", "http://localhost:3100/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
networks:
|
|
- flashpoint-network
|
|
|
|
# Game Service (Proxy and ZIP Server)
|
|
game-service:
|
|
image: <dockerhub-username>/flashpoint-game-service:latest
|
|
container_name: flashpoint-game-service
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${PROXY_PORT:-22500}:22500" # Proxy server
|
|
- "${GAMEZIP_PORT:-22501}:22501" # GameZip server
|
|
volumes:
|
|
- ${FLASHPOINT_HOST_PATH:?FLASHPOINT_HOST_PATH environment variable must be set}:/data/flashpoint:ro
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-production}
|
|
- TZ=${TZ:-UTC}
|
|
- PROXY_PORT=22500
|
|
- GAMEZIPSERVER_PORT=22501
|
|
# Flashpoint base path (all other paths derived automatically)
|
|
- FLASHPOINT_PATH=/data/flashpoint
|
|
# Application settings
|
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
|
healthcheck:
|
|
test: ["CMD", "curl", "--fail", "http://localhost:22500/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
networks:
|
|
- flashpoint-network
|
|
|
|
# Frontend Service (Nginx serving built files)
|
|
frontend:
|
|
image: <dockerhub-username>/flashpoint-frontend:latest
|
|
container_name: flashpoint-frontend
|
|
restart: unless-stopped
|
|
environment:
|
|
- TZ=${TZ:-UTC}
|
|
ports:
|
|
- "${WEB_PORT:-80}:8080"
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "--fail", "http://localhost:8080/"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- flashpoint-network
|
|
|
|
networks:
|
|
flashpoint-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
# Persistent volume for user database
|
|
backend-db:
|
|
driver: local
|
|
|
|
# =============================================================================
|
|
# Quick Start with Pre-built Images
|
|
# =============================================================================
|
|
#
|
|
# 1. Set required environment variables:
|
|
# export FLASHPOINT_HOST_PATH=/path/to/flashpoint
|
|
# export JWT_SECRET=$(openssl rand -base64 32)
|
|
#
|
|
# 2. Optional: Authenticate to Docker Hub (for private images):
|
|
# docker login docker.io
|
|
#
|
|
# 3. Pull and start:
|
|
# docker-compose -f docker-compose.images.yml pull
|
|
# docker-compose -f docker-compose.images.yml up -d
|
|
#
|
|
# Benefits of using pre-built images:
|
|
# - No build time (start immediately)
|
|
# - Consistent versions across environments
|
|
# - Smaller local disk usage (no build context)
|
|
# - Tested and validated images from CI/CD
|
|
#
|
|
# =============================================================================
|