Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: smaller container image #279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.venv
.env
.env
.git
.github
Dockerfile
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM python:3.11-slim-bookworm as base
FROM python:3.11-slim-bookworm AS base

# Use args
ARG USE_CUDA
ARG USE_CUDA_VER

## Basis ##
ENV ENV=prod \
PORT=9099 \
# pass build args to the build
USE_CUDA_DOCKER=${USE_CUDA} \
# Pass build args to the build
ENV USE_CUDA_DOCKER=${USE_CUDA} \
USE_CUDA_DOCKER_VER=${USE_CUDA_VER}


Expand All @@ -30,11 +27,17 @@ RUN pip3 install uv && \
fi
RUN uv pip install --system -r requirements.txt --no-cache-dir

# Copy the application code
FROM python:3.11-slim-bookworm AS final
# Copy installed dependencies
COPY --from=base /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=base /usr/local/include /usr/local/include
COPY --from=base /usr/local/bin /usr/local/bin
COPY . .

# Expose the port
ENV HOST="0.0.0.0"
ENV PORT="9099"
ENV ENV=prod
ENV PORT=9099

ENTRYPOINT [ "bash", "start.sh" ]
ENTRYPOINT [ "bash", "start.sh" ]