[功能] 添加 Docker Compose 配置以支持 PostgreSQL 数据库和 Openflare 服务

This commit is contained in:
ryan
2026-03-17 14:06:47 +08:00
parent cfd7c3d7ca
commit b60ebf231c
2 changed files with 45 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
web/node_modules
web/.next
web/build
web/out
upload
logs
.git
.github
+35
View File
@@ -0,0 +1,35 @@
services:
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: openflare
POSTGRES_USER: openflare
POSTGRES_PASSWORD: replace-with-strong-password
volumes:
- ./postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U openflare -d openflare"]
interval: 10s
timeout: 5s
retries: 5
openflare:
build:
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ports:
- "3000:3000"
environment:
SESSION_SECRET: replace-with-random-string
SQLITE_PATH: /data/openflare.db
DSN: postgres://openflare:replace-with-strong-password@postgres:5432/openflare?sslmode=disable
GIN_MODE: release
LOG_LEVEL: info
volumes:
- ./openflare-data:/data