Skip to content

Commit

Permalink
build: update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrodrigo19 committed Oct 16, 2024
1 parent 5cc9f10 commit b8939e3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
FROM python:3.11-slim-bookworm
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim

RUN apt-get update \
&& apt-get --no-install-recommends install -y build-essential libpq-dev python3-dev \
&& apt-get clean

COPY --from=ghcr.io/astral-sh/uv:0.4.16 /uv /uvx /bin/

WORKDIR /app

ENV UV_COMPILE_BYTECODE=1

ENV UV_LINK_MODE=copy

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 --frozen --no-install-project --no-dev

COPY . /app

RUN uv sync --frozen
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev

ENV PATH="/app/.venv/bin:$PATH"


EXPOSE 8000

Expand Down

0 comments on commit b8939e3

Please sign in to comment.