mirror of
https://github.com/zsai001/vstats.git
synced 2026-06-05 11:12:17 +08:00
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
vstats-server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: vstats-server
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${VSTATS_PORT:-3001}:${VSTATS_PORT:-3001}"
|
|
environment:
|
|
- VSTATS_PORT=${VSTATS_PORT:-3001}
|
|
- VSTATS_WEB_DIR=/app/web/dist
|
|
- VSTATS_CONFIG_PATH=/app/data/vstats-config.json
|
|
- VSTATS_DB_PATH=/app/data/vstats.db
|
|
volumes:
|
|
# Mount data directory for persistent storage
|
|
# Config file and database will be stored here
|
|
- ./data:/app/data
|
|
# Optional: mount custom config file
|
|
# - ./vstats-config.json:/app/data/vstats-config.json:ro
|
|
# Note: Container runs as vstats user (uid/gid 1000:1000)
|
|
# If you encounter permission issues, either:
|
|
# 1. Set data directory ownership: sudo chown -R 1000:1000 ./data
|
|
# 2. Or uncomment the line below to run as root (less secure):
|
|
# user: "0:0"
|
|
healthcheck:
|
|
test: ["CMD", "/app/vstats-server", "version"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- vstats-network
|
|
|
|
networks:
|
|
vstats-network:
|
|
driver: bridge
|
|
|