Added apt folder cleaning

This commit is contained in:
Job 2021-10-15 11:20:07 +00:00 committed by GitHub
parent be82600fe6
commit 4e5ca3b30b
1 changed files with 16 additions and 14 deletions

View File

@ -12,25 +12,27 @@ ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Add poetry to PATH
ENV PATH="${PATH}:/root/.poetry/bin"
WORKDIR /code
# Copy poetry files
COPY poetry.lock pyproject.toml ./
# Install and setup poetry
RUN pip install -U pip \
&& apt-get update \
&& apt install -y curl netcat gcc python3-dev \
&& curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
&& curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - \
# Remove curl and netcat from the image
&& apt-get purge -y curl netcat \
# Run poetry
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --no-root \
# Clear apt cache
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
ENV PATH="${PATH}:/root/.poetry/bin"
WORKDIR /code
# install dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --no-root
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# copy npm packages
COPY --from=npm /code /code