-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (18 loc) · 814 Bytes
/
Dockerfile
File metadata and controls
30 lines (18 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.12-slim-bookworm
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV TZ=Asia/Shanghai
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project
COPY pyproject.toml uv.lock .
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev
# COPY requirements.txt .
# RUN pip3 install -i https://mirrors.cloud.tencent.com/pypi/simple --no-cache-dir --upgrade -r requirements.txt
ENV PATH="/app/.venv/bin:$PATH"
COPY . .
RUN mkdir -p /data/logs && chmod -R 777 /data/logs
RUN chmod +x /app/docker-entrypoint.sh
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["gunicorn", "-c", "gunicorn.conf.py", "manage:app"]