Skip to content

Commit

Permalink
feat: migration Docker pour uv python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
herve.le-bars committed Nov 1, 2024
1 parent 9c2f95f commit b6f757b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ RUN apt-get update &&\


# Define working directory
ARG VIRTUAL_ENV=/.venv
ENV PATH=${VIRTUAL_ENV}/bin:$PATH \
VIRTUAL_ENV=${VIRTUAL_ENV}
ARG PROJECT_DIR=/project
ENV PROJECT_DIR=${PROJECT_DIR}
WORKDIR ${PROJECT_DIR}
Expand All @@ -26,16 +29,16 @@ RUN pip install --upgrade pip && pip install --user "poetry==$POETRY_VERSION"
ENV PATH="${PATH}:/root/.local/bin"
COPY ./backend/pyproject.toml ./backend/alembic.ini ./backend/

ENV PATH=/venv/bin:$PATH \
VIRTUAL_ENV=/venv

# Install UV
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

RUN . ~/.cargo/env &&\
ARG UV_PROJECT_ENVIRONMENT=${VIRTUAL_ENV}
ENV UV_PROJECT_ENVIRONMENT=${VIRTUAL_ENV}
RUN \
. ~/.cargo/env &&\
cd backend &&\
uv venv /venv &&\
echo ". /venv/bin/activate" >> /root/.bashrc &&\
uv venv ${VIRTUAL_ENV} &&\
echo ". ${VIRTUAL_ENV}/bin/activate" >> /root/.bashrc &&\
uv sync

# Launch cron services
Expand Down

0 comments on commit b6f757b

Please sign in to comment.