feat: initial features

This commit is contained in:
Darkraise
2026-01-16 23:58:21 +07:00
parent fc191fd61c
commit c7b617cf08
297 changed files with 58496 additions and 0 deletions
+149
View File
@@ -0,0 +1,149 @@
version: '3.8'
services:
# Backend API Service
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: flashpoint-backend:latest
container_name: flashpoint-backend
restart: unless-stopped
ports:
- "${API_PORT:-3001}:3001"
volumes:
- ${FLASHPOINT_HOST_PATH:-D:/Flashpoint}:/data/flashpoint:ro
environment:
- NODE_ENV=${NODE_ENV:-production}
- PORT=3001
- HOST=0.0.0.0
- FLASHPOINT_PATH=/data/flashpoint
- FLASHPOINT_DB_PATH=/data/flashpoint/Data/flashpoint.sqlite
- FLASHPOINT_HTDOCS_PATH=/data/flashpoint/Legacy/htdocs
- FLASHPOINT_IMAGES_PATH=/data/flashpoint/Data/Images
- FLASHPOINT_LOGOS_PATH=/data/flashpoint/Data/Logos
- FLASHPOINT_PLAYLISTS_PATH=/data/flashpoint/Data/Playlists
- FLASHPOINT_GAMES_PATH=/data/flashpoint/Data/Games
- GAME_SERVICE_PROXY_URL=http://game-service:22500
- GAME_SERVICE_GAMEZIP_URL=http://game-service:22501
- EXTERNAL_IMAGE_URLS=${EXTERNAL_IMAGE_URLS:-https://infinity.flashpointarchive.org/Flashpoint/Data/Images,https://infinity.unstable.life/Flashpoint/Data/Images}
- CORS_ORIGIN=${CORS_ORIGIN:-http://localhost}
- LOG_LEVEL=${LOG_LEVEL:-info}
depends_on:
- game-service
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- flashpoint-network
# Game Service (Proxy and ZIP Server)
game-service:
build:
context: ./game-service
dockerfile: Dockerfile
image: 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:-D:/Flashpoint}:/data/flashpoint:ro
environment:
- NODE_ENV=${NODE_ENV:-production}
- PROXY_PORT=22500
- GAMEZIPSERVER_PORT=22501
- FLASHPOINT_PATH=/data/flashpoint
- FLASHPOINT_HTDOCS_PATH=/data/flashpoint/Legacy/htdocs
- FLASHPOINT_GAMES_PATH=/data/flashpoint/Data/Games
- EXTERNAL_FALLBACK_URLS=${EXTERNAL_FALLBACK_URLS:-http://infinity.flashpointarchive.org/Flashpoint/Legacy/htdocs,http://infinity.unstable.life/Flashpoint/Legacy/htdocs/}
- LOG_LEVEL=${LOG_LEVEL:-info}
- ALLOW_CROSS_DOMAIN=true
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:22500/', (res) => { process.exit(res.statusCode < 500 ? 0 : 1); }).on('error', () => process.exit(1));"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- flashpoint-network
# Frontend Service (Nginx serving built files)
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: flashpoint-frontend:latest
container_name: flashpoint-frontend
restart: unless-stopped
ports:
- "${WEB_PORT:-80}:80"
environment:
- VITE_API_URL=http://localhost:${API_PORT:-3001}
depends_on:
- backend
networks:
- flashpoint-network
networks:
flashpoint-network:
driver: bridge
# =============================================================================
# Flashpoint Web App - Docker Compose Configuration
# =============================================================================
#
# This configuration runs all three services:
# - backend: REST API (port 3001)
# - game-service: Proxy and ZIP server (ports 22500, 22501)
# - frontend: Web UI (port 80)
#
# Usage:
# ------
# 1. Set environment variables (optional):
# export FLASHPOINT_HOST_PATH=D:/Flashpoint
# export NODE_ENV=production
# export LOG_LEVEL=info
#
# 2. Build all services:
# docker-compose build
#
# 3. Start all services:
# docker-compose up -d
#
# 4. Start specific services:
# docker-compose up -d backend game-service
#
# 5. View logs:
# docker-compose logs -f
# docker-compose logs -f backend
# docker-compose logs -f game-service
#
# 6. Stop all services:
# docker-compose down
#
# 7. Rebuild and restart:
# docker-compose up -d --build
#
# Access:
# -------
# - Frontend: http://localhost
# - Backend API: http://localhost:3001
# - Game Proxy: http://localhost:22500
# - GameZip: http://localhost:22501
#
# Environment Variables:
# ----------------------
# FLASHPOINT_HOST_PATH - Path to your Flashpoint installation (default: D:/Flashpoint)
# NODE_ENV - Environment (development/production, default: production)
# LOG_LEVEL - Logging level (error/warn/info/debug, default: info)
# WEB_PORT - Frontend port (default: 80)
# API_PORT - Backend API port (default: 3001)
# PROXY_PORT - Game proxy port (default: 22500)
# GAMEZIP_PORT - GameZip server port (default: 22501)
# CORS_ORIGIN - CORS origin for API (default: http://localhost)
# =============================================================================