43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
|
||
services:
|
||
db:
|
||
image: pgvector/pgvector:pg15 # 换成这个
|
||
container_name: inventory_db
|
||
restart: always
|
||
environment:
|
||
POSTGRES_USER: test
|
||
POSTGRES_PASSWORD: 1234
|
||
POSTGRES_DB: inventory_system
|
||
volumes:
|
||
- ./pgdata_docker:/var/lib/postgresql/data # 这里保持不变,Docker会自动创建这个新文件夹
|
||
ports:
|
||
- "5435:5432"
|
||
|
||
backend:
|
||
build:
|
||
context: ./inventory-backend
|
||
container_name: inventory_api
|
||
restart: always
|
||
ports:
|
||
- "8000:8000"
|
||
volumes:
|
||
- ./inventory-backend:/app
|
||
- ./inventory-backend/uploads:/app/uploads
|
||
command: gunicorn -c gunicorn.conf.py run:app --reload
|
||
environment:
|
||
DATABASE_URL: postgresql://test:1234@db:5432/inventory_system
|
||
depends_on:
|
||
- db
|
||
|
||
frontend:
|
||
build:
|
||
context: ./inventory-web
|
||
container_name: inventory_ui
|
||
restart: always
|
||
volumes:
|
||
- ./inventory-web:/app
|
||
- /app/node_modules
|
||
ports:
|
||
- "5175:5173"
|
||
depends_on:
|
||
- backend |