Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ docker compose up --build

Open `http://localhost:7860`

后端单独镜像:

```bash
docker build -t wendui-backend:local ./backend
docker run --rm -p 7860:7860 \
-e SECRET_KEY=change-me \
-e CORS_ORIGINS='["*"]' \
-e DB_URL='mysql+pymysql://wendui:wendui@host.docker.internal:3306/wendui' \
-e OPENAI_API_KEY= \
-e MINIMAX_API_KEY= \
wendui-backend:local
```

## Deployment Notes

- 默认使用 MySQL(Docker Compose 会启动 `mysql` 服务),数据保存在 `mysql-data` 卷中。
Expand Down
20 changes: 20 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_PROJECT_ENVIRONMENT=/opt/venv \
PATH="/opt/venv/bin:$PATH"

WORKDIR /app/backend

RUN pip install --no-cache-dir --upgrade pip uv

COPY pyproject.toml uv.lock README.md ./
RUN uv venv /opt/venv
RUN uv sync --frozen --no-dev

COPY . .

EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]