Files
YG-Datasets/docker-compose.yml

53 lines
1.0 KiB
YAML
Raw Permalink 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:
# FastAPI 后端 (SQLite 数据库,随项目文件存储)
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: ygdataset-backend
ports:
- "8000:8000"
environment:
- DATABASE_URL=sqlite:///./ygdataset.db
- DEBUG=true
volumes:
- ./backend:/app
- uploads:/app/uploads
restart: unless-stopped
# Vue 前端
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: ygdataset-frontend
ports:
- "3000:80"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
restart: unless-stopped
volumes:
uploads:
# 如需 PostgreSQL取消注释以下配置
# services:
# postgres:
# image: postgres:15
# environment:
# POSTGRES_USER: ygdataset
# POSTGRES_PASSWORD: your_password
# POSTGRES_DB: ygdataset
# ports:
# - "5432:5432"
# volumes:
# - postgres_data:/var/lib/postgresql/data
# volumes:
# postgres_data: