37 lines
1.3 KiB
YAML
37 lines
1.3 KiB
YAML
# My INMU:簽到伺服器(FastAPI + SQLite)與網站
|
||
# 用法:複製 .env.example 成 .env 後執行 docker compose up -d --build
|
||
|
||
name: myinmu
|
||
|
||
services:
|
||
app:
|
||
build:
|
||
context: .
|
||
dockerfile: server/Dockerfile
|
||
environment:
|
||
PUBLIC_URL: ${PUBLIC_URL:-http://127.0.0.1:2040}
|
||
COOKIE_SECURE: ${COOKIE_SECURE:-0}
|
||
BETA: ${BETA:-1} # 1 = 網頁標題與小卡標示 Beta;正式上線設 0
|
||
SMTP_HOST: ${SMTP_HOST:-smtp.gmail.com}
|
||
SMTP_PORT: ${SMTP_PORT:-465}
|
||
SMTP_USER: ${SMTP_USER:-}
|
||
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
|
||
MAIL_FROM: ${MAIL_FROM:[email protected]}
|
||
ADMIN_LOGIN: ${ADMIN_LOGIN:-}
|
||
ADMIN_TOTP: ${ADMIN_TOTP:-}
|
||
TZ: Asia/Taipei # 容器時區(log、date);換日邏輯在程式裡固定用台灣時間 04:00
|
||
volumes:
|
||
- inmu-data:/data # inmu.db、avatars/、cards/
|
||
- ./image:/memes # 迷因圖放在 image/;管理員同意的投稿也會寫進這裡(inmu_<n>.jpg)
|
||
ports:
|
||
- "127.0.0.1:${PORT:-2040}:2040"
|
||
restart: unless-stopped
|
||
healthcheck:
|
||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:2040/healthz')"]
|
||
interval: 30s
|
||
timeout: 5s
|
||
retries: 3
|
||
|
||
volumes:
|
||
inmu-data:
|