添加聊天窗口,后端docker部署

This commit is contained in:
2026-04-01 10:03:24 +08:00
parent be26ad3eee
commit dceac6f951
5 changed files with 258 additions and 1 deletions

17
backend/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM python:3.11-slim
WORKDIR /app
# 先复制 requirements 以利用 Docker 缓存
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 复制其余代码和数据(如果在后端的相对路径下需要读取)
COPY . .
# 暴露 FastAPI 使用的端口
EXPOSE 8000
# 启动 FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]

View File

@@ -1,4 +1,21 @@
services:
backend:
build: .
container_name: dt_backend
ports:
- "8001:8000"
volumes:
- ../data:/data
env_file:
- .env
environment:
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=dtmap2024
depends_on:
neo4j:
condition: service_healthy
neo4j:
image: neo4j:5-community
container_name: dt_neo4j