Initial commit: FunConnect project with server, relay, client and admin panel
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
78
docker-compose.yml
Normal file
78
docker-compose.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# PostgreSQL 数据库
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: funmc-postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: funmc
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-funmc_secret_password}
|
||||
POSTGRES_DB: funmc
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U funmc"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- funmc-network
|
||||
|
||||
# FunMC API 服务器
|
||||
server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.server
|
||||
container_name: funmc-server
|
||||
restart: always
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: postgres://funmc:${DB_PASSWORD:-funmc_secret_password}@postgres/funmc
|
||||
JWT_SECRET: ${JWT_SECRET:-change_this_in_production}
|
||||
LISTEN_ADDR: 0.0.0.0:3000
|
||||
RUST_LOG: info
|
||||
SERVER_NAME: ${SERVER_NAME:-FunMC Server}
|
||||
SERVER_IP: ${SERVER_IP:-}
|
||||
SERVER_DOMAIN: ${SERVER_DOMAIN:-}
|
||||
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
|
||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-admin123}
|
||||
ADMIN_PANEL_DIR: /app/admin-panel
|
||||
DOWNLOADS_DIR: /app/downloads
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3001:3001/udp"
|
||||
volumes:
|
||||
- admin_panel:/app/admin-panel
|
||||
- downloads:/app/downloads
|
||||
networks:
|
||||
- funmc-network
|
||||
|
||||
# FunMC 中继服务器
|
||||
relay:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.relay
|
||||
container_name: funmc-relay
|
||||
restart: always
|
||||
environment:
|
||||
RELAY_PORT: 7900
|
||||
JWT_SECRET: ${JWT_SECRET:-change_this_in_production}
|
||||
RUST_LOG: info
|
||||
ports:
|
||||
- "7900:7900/udp"
|
||||
- "7901:7901/udp"
|
||||
networks:
|
||||
- funmc-network
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
admin_panel:
|
||||
downloads:
|
||||
|
||||
networks:
|
||||
funmc-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user