完善微博半自动凭证与本地开发环境
This commit is contained in:
+23
-16
@@ -6,7 +6,7 @@ x-json-log-rotation: &json-log-rotation
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: ${BASE_REGISTRY:-docker.m.daocloud.io}/library/postgres:16-bookworm
|
||||
image: postgres:16-bookworm
|
||||
command:
|
||||
[
|
||||
"postgres",
|
||||
@@ -51,29 +51,35 @@ services:
|
||||
- postgres_dev_data:/var/lib/postgresql/data
|
||||
|
||||
minio:
|
||||
image: ${BASE_REGISTRY:-docker.m.daocloud.io}/minio/minio:latest
|
||||
# MinIO 官方镜像已停止维护;使用固定版本的 Bitnami Legacy 构建,避免 latest 漂移。
|
||||
image: bitnamilegacy/minio:2025.7.23-debian-12-r5
|
||||
# 首次启动以 root 修正既有 dev volume 的权限,随后镜像脚本会降权为 minio 用户运行。
|
||||
user: "0"
|
||||
restart: unless-stopped
|
||||
logging: *json-log-rotation
|
||||
command: server /data --address ":9000" --console-address ":9001"
|
||||
environment:
|
||||
TZ: ${TZ:-Asia/Shanghai}
|
||||
MINIO_ROOT_USER: ${STORAGE_ACCESS_KEY_ID:-minioadmin}
|
||||
MINIO_ROOT_PASSWORD: ${STORAGE_SECRET_ACCESS_KEY:-minioadmin}
|
||||
MINIO_API_PORT_NUMBER: "9000"
|
||||
MINIO_CONSOLE_PORT_NUMBER: "9001"
|
||||
MINIO_BROWSER: "on"
|
||||
ports:
|
||||
- "${MINIO_API_PORT:-19000}:9000"
|
||||
- "${MINIO_CONSOLE_PORT:-19001}:9001"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:9000/minio/health/live"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
start_period: 10s
|
||||
volumes:
|
||||
- minio_dev_data:/data
|
||||
- minio_dev_data:/bitnami/minio/data
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: deploy/docker/backend-dev.Dockerfile
|
||||
args:
|
||||
# 基础镜像源(registry 前缀),与生产 compose 同一套语义。
|
||||
BASE_REGISTRY: ${BASE_REGISTRY:-docker.m.daocloud.io}
|
||||
DEBIAN_MIRROR: ${DEBIAN_MIRROR:-mirrors.aliyun.com}
|
||||
NPM_REGISTRY: ${NPM_REGISTRY:-https://registry.npmmirror.com}
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
@@ -83,10 +89,13 @@ services:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
minio:
|
||||
condition: service_started
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD-SHELL", "curl -fsS http://127.0.0.1:3000/health/ready || exit 1"]
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"node -e \"fetch('http://127.0.0.1:3000/health/ready').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"",
|
||||
]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
@@ -136,7 +145,7 @@ services:
|
||||
- ./apps/backend/data:/app/data
|
||||
|
||||
frontend:
|
||||
image: ${BASE_REGISTRY:-docker.m.daocloud.io}/library/node:22-bookworm-slim
|
||||
image: node:22-bookworm-slim
|
||||
working_dir: /app
|
||||
restart: unless-stopped
|
||||
logging: *json-log-rotation
|
||||
@@ -147,7 +156,6 @@ services:
|
||||
environment:
|
||||
TZ: ${TZ:-Asia/Shanghai}
|
||||
CHOKIDAR_USEPOLLING: "true"
|
||||
NPM_CONFIG_REGISTRY: https://registry.npmmirror.com
|
||||
VITE_API_TARGET: http://backend:3000
|
||||
VITE_ALLOWED_HOSTS: ${VITE_ALLOWED_HOSTS:-localhost,127.0.0.1}
|
||||
VITE_WORKER_SITE_URL: ${WORKER_SITE_ADDR:-http://worker.localhost}
|
||||
@@ -160,7 +168,7 @@ services:
|
||||
# 打手端专用 dev server:同一份代码,只把「打手端 hostname」设成 IP,
|
||||
# 由 Caddy 的 8080 端口反代过来(前端按 hostname 判站点,见 utils/site.ts)。
|
||||
frontend-worker:
|
||||
image: ${BASE_REGISTRY:-docker.m.daocloud.io}/library/node:22-bookworm-slim
|
||||
image: node:22-bookworm-slim
|
||||
working_dir: /app
|
||||
restart: unless-stopped
|
||||
logging: *json-log-rotation
|
||||
@@ -174,7 +182,6 @@ services:
|
||||
environment:
|
||||
TZ: ${TZ:-Asia/Shanghai}
|
||||
CHOKIDAR_USEPOLLING: "true"
|
||||
NPM_CONFIG_REGISTRY: https://registry.npmmirror.com
|
||||
VITE_API_TARGET: http://backend:3000
|
||||
VITE_ALLOWED_HOSTS: ${VITE_ALLOWED_HOSTS:-localhost,127.0.0.1}
|
||||
VITE_WORKER_SITE_URL: ${WORKER_SITE_ADDR_IP:-http://192.168.10.8}
|
||||
@@ -185,7 +192,7 @@ services:
|
||||
- frontend_worker_node_modules:/app/node_modules
|
||||
|
||||
web:
|
||||
image: ${BASE_REGISTRY:-docker.m.daocloud.io}/library/caddy:2-alpine
|
||||
image: caddy:2-alpine
|
||||
restart: unless-stopped
|
||||
logging: *json-log-rotation
|
||||
depends_on:
|
||||
|
||||
Reference in New Issue
Block a user