first commit
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -3,8 +3,15 @@ FROM python:3.12-slim
|
|||||||
# Install uv.
|
# Install uv.
|
||||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR /env_build
|
||||||
|
|
||||||
# Copy the application into the container.
|
# 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.
|
# Install the application dependencies.
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -12,13 +19,11 @@ WORKDIR /app
|
|||||||
# 更新索引并安装替代包
|
# 更新索引并安装替代包
|
||||||
RUN apt-get update && apt-get install -y vim
|
RUN apt-get update && apt-get install -y vim
|
||||||
|
|
||||||
RUN uv sync --frozen --no-cache
|
#CMD ["tail","-f","/dev/null"]
|
||||||
|
|
||||||
# Run the application.
|
# Run the application.
|
||||||
CMD ["tail", "-f", "/dev/null"]
|
CMD ["gunicorn", "main:app_server", \
|
||||||
#CMD ["/app/.venv/bin/gunicorn", "app.main:app", \
|
"-w", "4", \
|
||||||
# "-w", "4", \
|
"-k", "uvicorn.workers.UvicornWorker", \
|
||||||
# "-k", "uvicorn.workers.UvicornWorker", \
|
"--bind", "0.0.0.0:80", \
|
||||||
# "--bind", "0.0.0.0:80", \
|
"--access-logfile", "-", \
|
||||||
# "--access-logfile", "-", \
|
"--error-logfile", "-"]
|
||||||
# "--error-logfile", "-"]
|
|
||||||
@@ -6,7 +6,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
volumes:
|
volumes:
|
||||||
- ./app:/app/app
|
- ./:/app
|
||||||
- ./.env:/app/.env
|
- ./.env:/app/.env
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user