添加聊天窗口,后端docker部署
This commit is contained in:
17
backend/Dockerfile
Normal file
17
backend/Dockerfile
Normal 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"]
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user