Files
SmyWorkCollect/SproutWorkCollect-Backend-Golang/docker-compose.yml

30 lines
1.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
sproutworkcollect-api:
build:
context: .
dockerfile: Dockerfile
container_name: sproutworkcollect-backend-go
restart: unless-stopped
ports:
- "${SPROUTWORKCOLLECT_PORT:-5000}:5000"
environment:
- PORT=5000
- SPROUTWORKCOLLECT_DATA_DIR=/data
# Override the default admin token (strongly recommended in production):
# - ADMIN_TOKEN=your_secure_token_here
# Enable verbose Gin logging (set to 1 for debugging):
# - GIN_DEBUG=0
volumes:
# 默认挂载项目目录下的 data/,部署到服务器时设置 SPROUTWORKCOLLECT_DATA_PATH 覆盖
# 例如export SPROUTWORKCOLLECT_DATA_PATH=/shumengya/docker/sproutworkcollect/data
- "${SPROUTWORKCOLLECT_DATA_PATH:-./data}/works:/data/works"
- "${SPROUTWORKCOLLECT_DATA_PATH:-./data}/config:/data/config"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:5000/api/settings"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s