feat(docker): 添加docker-compose版本声明
为docker-compose.yml文件添加version "3.8"声明, 确保使用兼容的compose文件格式版本。
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
# PostgreSQL
|
||||||
|
POSTGRES_USER=shiran
|
||||||
|
POSTGRES_PASSWORD=change-me-postgres-password
|
||||||
|
POSTGRES_DB=ciyuan_viewfinder
|
||||||
|
POSTGRES_PGDATA=/var/lib/postgresql/data/pgdata
|
||||||
|
|
||||||
|
# Redis
|
||||||
|
REDIS_URL=redis://redis:6379/0
|
||||||
|
|
||||||
|
# MinIO / S3
|
||||||
|
MINIO_ROOT_USER=minioadmin
|
||||||
|
MINIO_ROOT_PASSWORD=change-me-minio-password
|
||||||
|
S3_ENDPOINT=http://minio:9000
|
||||||
|
S3_ACCESS_KEY=minioadmin
|
||||||
|
S3_SECRET_KEY=change-me-minio-password
|
||||||
|
S3_BUCKET=ciyuan-viewfinder
|
||||||
|
|
||||||
|
# Server
|
||||||
|
DATABASE_URL=postgresql+asyncpg://shiran:change-me-postgres-password@postgres:5432/ciyuan_viewfinder
|
||||||
|
DATABASE_URL_SYNC=postgresql://shiran:change-me-postgres-password@postgres:5432/ciyuan_viewfinder
|
||||||
|
SECRET_KEY=change-me-before-production
|
||||||
|
ACCESS_TOKEN_EXPIRE_MINUTES=43200
|
||||||
|
REFRESH_TOKEN_EXPIRE_DAYS=60
|
||||||
|
STORAGE_BACKEND=local
|
||||||
|
LOCAL_STORAGE_PATH=/app/uploads
|
||||||
|
TENCENT_MAP_KEY=
|
||||||
|
LOG_LEVEL=INFO
|
||||||
|
LOG_JSON=false
|
||||||
|
|
||||||
|
# Frontend build
|
||||||
|
VITE_API_BASE=/api/v1
|
||||||
|
|
||||||
|
# Nginx host ports
|
||||||
|
CLIENT_WEB_PORT=5173
|
||||||
|
ADMIN_WEB_PORT=5174
|
||||||
+26
-24
@@ -1,12 +1,14 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgis/postgis:17-3.5
|
image: postgis/postgis:17-3.5
|
||||||
container_name: ciyuan-postgres
|
container_name: ciyuan-postgres
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: "${POSTGRES_USER:-shiran}"
|
POSTGRES_USER: "${POSTGRES_USER}"
|
||||||
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-change-me-postgres-password}"
|
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
|
||||||
POSTGRES_DB: "${POSTGRES_DB:-ciyuan_viewfinder}"
|
POSTGRES_DB: "${POSTGRES_DB}"
|
||||||
PGDATA: /var/lib/postgresql/data/pgdata
|
PGDATA: "${POSTGRES_PGDATA}"
|
||||||
expose:
|
expose:
|
||||||
- "5432"
|
- "5432"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -43,8 +45,8 @@ services:
|
|||||||
container_name: ciyuan-minio
|
container_name: ciyuan-minio
|
||||||
command: server /data --console-address ":9001"
|
command: server /data --console-address ":9001"
|
||||||
environment:
|
environment:
|
||||||
MINIO_ROOT_USER: "${MINIO_ROOT_USER:-minioadmin}"
|
MINIO_ROOT_USER: "${MINIO_ROOT_USER}"
|
||||||
MINIO_ROOT_PASSWORD: "${MINIO_ROOT_PASSWORD:-minioadmin}"
|
MINIO_ROOT_PASSWORD: "${MINIO_ROOT_PASSWORD}"
|
||||||
expose:
|
expose:
|
||||||
- "9000"
|
- "9000"
|
||||||
- "9001"
|
- "9001"
|
||||||
@@ -59,21 +61,21 @@ services:
|
|||||||
context: ./server
|
context: ./server
|
||||||
container_name: ciyuan-server
|
container_name: ciyuan-server
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "postgresql+asyncpg://${POSTGRES_USER:-shiran}:${POSTGRES_PASSWORD:-change-me-postgres-password}@postgres:5432/${POSTGRES_DB:-ciyuan_viewfinder}"
|
DATABASE_URL: "${DATABASE_URL}"
|
||||||
DATABASE_URL_SYNC: "postgresql://${POSTGRES_USER:-shiran}:${POSTGRES_PASSWORD:-change-me-postgres-password}@postgres:5432/${POSTGRES_DB:-ciyuan_viewfinder}"
|
DATABASE_URL_SYNC: "${DATABASE_URL_SYNC}"
|
||||||
REDIS_URL: redis://redis:6379/0
|
REDIS_URL: "${REDIS_URL}"
|
||||||
SECRET_KEY: "${SECRET_KEY:-change-me-before-production}"
|
SECRET_KEY: "${SECRET_KEY}"
|
||||||
ACCESS_TOKEN_EXPIRE_MINUTES: "${ACCESS_TOKEN_EXPIRE_MINUTES:-43200}"
|
ACCESS_TOKEN_EXPIRE_MINUTES: "${ACCESS_TOKEN_EXPIRE_MINUTES}"
|
||||||
REFRESH_TOKEN_EXPIRE_DAYS: "${REFRESH_TOKEN_EXPIRE_DAYS:-60}"
|
REFRESH_TOKEN_EXPIRE_DAYS: "${REFRESH_TOKEN_EXPIRE_DAYS}"
|
||||||
STORAGE_BACKEND: local
|
STORAGE_BACKEND: "${STORAGE_BACKEND}"
|
||||||
LOCAL_STORAGE_PATH: /app/uploads
|
LOCAL_STORAGE_PATH: "${LOCAL_STORAGE_PATH}"
|
||||||
S3_ENDPOINT: http://minio:9000
|
S3_ENDPOINT: "${S3_ENDPOINT}"
|
||||||
S3_ACCESS_KEY: "${MINIO_ROOT_USER:-minioadmin}"
|
S3_ACCESS_KEY: "${S3_ACCESS_KEY}"
|
||||||
S3_SECRET_KEY: "${MINIO_ROOT_PASSWORD:-minioadmin}"
|
S3_SECRET_KEY: "${S3_SECRET_KEY}"
|
||||||
S3_BUCKET: "${S3_BUCKET:-ciyuan-viewfinder}"
|
S3_BUCKET: "${S3_BUCKET}"
|
||||||
TENCENT_MAP_KEY: "${TENCENT_MAP_KEY:-}"
|
TENCENT_MAP_KEY: "${TENCENT_MAP_KEY}"
|
||||||
LOG_LEVEL: "${LOG_LEVEL:-INFO}"
|
LOG_LEVEL: "${LOG_LEVEL}"
|
||||||
LOG_JSON: "${LOG_JSON:-false}"
|
LOG_JSON: "${LOG_JSON}"
|
||||||
expose:
|
expose:
|
||||||
- "8000"
|
- "8000"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -105,7 +107,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./admin-web
|
context: ./admin-web
|
||||||
args:
|
args:
|
||||||
VITE_API_BASE: /api/v1
|
VITE_API_BASE: "${VITE_API_BASE}"
|
||||||
container_name: ciyuan-admin-web
|
container_name: ciyuan-admin-web
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
@@ -133,8 +135,8 @@ services:
|
|||||||
image: nginx:1.27-alpine
|
image: nginx:1.27-alpine
|
||||||
container_name: ciyuan-nginx
|
container_name: ciyuan-nginx
|
||||||
ports:
|
ports:
|
||||||
- "${CLIENT_WEB_PORT:-5173}:80"
|
- "${CLIENT_WEB_PORT}:80"
|
||||||
- "${ADMIN_WEB_PORT:-5174}:81"
|
- "${ADMIN_WEB_PORT}:81"
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
Reference in New Issue
Block a user