first commit

This commit is contained in:
zcr
2026-02-05 10:26:16 +08:00
parent 2882254111
commit ec195d17e1
2 changed files with 16 additions and 11 deletions

View File

@@ -3,8 +3,15 @@ FROM python:3.12-slim
# Install uv.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /env_build
# Copy the application into the container.
COPY . /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-cache
ENV PATH="/env_build/.venv/bin:$PATH"
# Install the application dependencies.
WORKDIR /app
@@ -12,13 +19,11 @@ WORKDIR /app
# 更新索引并安装替代包
RUN apt-get update && apt-get install -y vim
RUN uv sync --frozen --no-cache
#CMD ["tail","-f","/dev/null"]
# Run the application.
CMD ["tail", "-f", "/dev/null"]
#CMD ["/app/.venv/bin/gunicorn", "app.main:app", \
# "-w", "4", \
# "-k", "uvicorn.workers.UvicornWorker", \
# "--bind", "0.0.0.0:80", \
# "--access-logfile", "-", \
# "--error-logfile", "-"]
CMD ["gunicorn", "main:app_server", \
"-w", "4", \
"-k", "uvicorn.workers.UvicornWorker", \
"--bind", "0.0.0.0:80", \
"--access-logfile", "-", \
"--error-logfile", "-"]