Skip to content

Commit

Permalink
ci: fix docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
julesbertrand committed Nov 9, 2023
1 parent 4432fb1 commit bd67eac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ endif

.PHONY: check-safety
check-safety:
@poetry check$(POETRY_COMMAND_FLAG) && \
poetry check$(POETRY_COMMAND_FLAG) && \
poetry run pip check$(PIP_COMMAND_FLAG) && \
poetry run safety check --full-report$(SAFETY_COMMAND_FLAG) && \
poetry run bandit -r nlpretext/$(BANDIT_COMMAND_FLAG)
Expand All @@ -108,11 +108,11 @@ gitleaks:

.PHONY: format-code
format-code:
@poetry run pre-commit run --all
poetry run pre-commit run --all

.PHONY: test
test:
@poetry run pytest
poetry run pytest

.PHONY: lint
lint: check-safety format-code test
Expand Down
21 changes: 9 additions & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9.7-slim-buster
FROM python:3.10-slim-buster

ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
Expand All @@ -8,21 +8,18 @@ RUN apt-get update && \
curl coreutils \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -d /home/docker_user -m -s /bin/bash docker_user
USER docker_user
# Install Poetry
ENV POETRY_VERSION=1.5.1
RUN pip install --upgrade pip
RUN python3 -m pip install "poetry==$POETRY_VERSION"

RUN mkdir -p /home/docker_user/workspace
WORKDIR /home/docker_user/workspace

# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -

ENV PATH="${PATH}:/home/docker_user/.poetry/bin:/home/docker_user/poetry/bin"
WORKDIR /home/workspace

COPY pyproject.toml ./

RUN poetry lock
RUN poetry install --no-root --no-dev --no-interaction
RUN poetry config virtualenvs.create false \
&& poetry lock \
&& poetry install --no-root --no-dev --no-interaction

COPY . /home/docker_user/workspace/

Expand Down

0 comments on commit bd67eac

Please sign in to comment.