mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 10:08:36 +02:00
migrate dev dockerfile to uv
This commit is contained in:
@@ -1,14 +1,4 @@
|
|||||||
FROM python:3.11-slim-bookworm AS python-build-stage
|
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
|
||||||
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
||||||
build-essential \
|
|
||||||
libpq-dev \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY ../requirements.txt .
|
|
||||||
RUN pip wheel --wheel-dir /usr/src/app/wheels -r requirements.txt
|
|
||||||
|
|
||||||
FROM python:3.11-slim-bookworm AS python-run-stage
|
|
||||||
|
|
||||||
ARG VERSION=dev
|
ARG VERSION=dev
|
||||||
ENV APP_VERSION=$VERSION
|
ENV APP_VERSION=$VERSION
|
||||||
@@ -16,16 +6,16 @@ ENV APP_VERSION=$VERSION
|
|||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||||
PYTHONUNBUFFERED=1
|
PYTHONUNBUFFERED=1 \
|
||||||
|
UV_COMPILE_BYTECODE=1 \
|
||||||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
UV_LINK_MODE=copy
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install --no-install-recommends -y gettext supervisor && \
|
apt-get install --no-install-recommends -y gettext supervisor && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/*
|
||||||
pip install --upgrade pip && \
|
|
||||||
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
|
COPY pyproject.toml uv.lock ./
|
||||||
rm -rf /wheels/ ~/.cache/pip/*
|
RUN uv sync --frozen --no-install-project --no-dev
|
||||||
|
|
||||||
COPY ./docker/dev/django/start /start
|
COPY ./docker/dev/django/start /start
|
||||||
COPY ./docker/dev/procrastinate/start /start-procrastinate
|
COPY ./docker/dev/procrastinate/start /start-procrastinate
|
||||||
@@ -40,6 +30,8 @@ RUN sed -i 's/\r$//g' /start && \
|
|||||||
sed -i 's/\r$//g' /start-supervisor && \
|
sed -i 's/\r$//g' /start-supervisor && \
|
||||||
chmod +x /start-supervisor
|
chmod +x /start-supervisor
|
||||||
|
|
||||||
|
ENV PATH="/usr/src/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
COPY ./app .
|
COPY ./app .
|
||||||
|
|
||||||
CMD ["/start-supervisor"]
|
CMD ["/start-supervisor"]
|
||||||
|
|||||||
Reference in New Issue
Block a user