mirror of
https://github.com/insistence/RuoYi-Vue3-FastAPI.git
synced 2026-09-21 04:46:28 +00:00
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
services:
|
|
# 前端服务
|
|
ruoyi-frontend:
|
|
build:
|
|
context: ./ruoyi-fastapi-frontend
|
|
dockerfile: Dockerfile
|
|
image: ruoyi-frontend:latest
|
|
container_name: ruoyi-frontend
|
|
ports:
|
|
- "12580:80"
|
|
volumes:
|
|
- ./ruoyi-fastapi-frontend/bin/nginx.dockerpg.conf:/etc/nginx/conf.d/default.conf
|
|
depends_on:
|
|
- ruoyi-backend-pg
|
|
networks:
|
|
- ruoyi-network
|
|
|
|
# 后端服务(PostgreSQL版本)
|
|
ruoyi-backend-pg:
|
|
build:
|
|
context: ./ruoyi-fastapi-backend
|
|
dockerfile: Dockerfile.pg
|
|
image: ruoyi-backend-pg:latest
|
|
container_name: ruoyi-backend-pg
|
|
ports:
|
|
- "19099:9099"
|
|
depends_on:
|
|
- ruoyi-pg
|
|
- ruoyi-redis
|
|
networks:
|
|
- ruoyi-network
|
|
|
|
# PostgreSQL服务
|
|
ruoyi-pg:
|
|
image: postgres:14
|
|
container_name: ruoyi-pg
|
|
environment:
|
|
POSTGRES_PASSWORD: root
|
|
POSTGRES_DB: ruoyi-fastapi
|
|
POSTGRES_INITDB_ARGS: --encoding=UTF8 --lc-collate=C --lc-ctype=C
|
|
ports:
|
|
- "15432:5432"
|
|
volumes:
|
|
- ./ruoyi-fastapi-backend/sql/ruoyi-fastapi-pg.sql:/docker-entrypoint-initdb.d/ruoyi-fastapi-pg.sql
|
|
networks:
|
|
- ruoyi-network
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 30
|
|
|
|
# Redis服务
|
|
ruoyi-redis:
|
|
image: redis:latest
|
|
container_name: ruoyi-redis
|
|
ports:
|
|
- "16379:6379"
|
|
networks:
|
|
- ruoyi-network
|
|
|
|
# 网络配置
|
|
networks:
|
|
ruoyi-network:
|
|
name: ruoyi-network
|
|
driver: bridge |