diff --git a/Dockerfile b/Dockerfile index 9e36377..8b63e17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-slim AS base +FROM python:3.8-slim # We choose python-slim instead of alpine, a buildspeed vs image size tradeoff. # In case you need base debian dependencies install them here. @@ -6,8 +6,6 @@ FROM python:3.8-slim AS base # # TODO list depencies here \ # && apt-get clean && rm -rf /var/lib/apt/lists/* -# --- COMPILE-IMAGE --- -FROM base AS compile-image ENV DEBIAN_FRONTEND=noninteractive # Install dev dependencies @@ -23,31 +21,13 @@ RUN pip install --no-cache-dir pipenv WORKDIR /code COPY . /code -# Install packages, including the dev (test) packages. +# Install packages RUN PIPENV_VENV_IN_PROJECT=1 pipenv --three RUN pipenv lock -RUN pipenv sync --dev +RUN pipenv sync -# Run pytest tests. -# pipenv check fails due to a github connection error. Pipenv check scans for python -# vulnerabilities amongst other things. We might want to debug and fix this: -# RUN PIPENV_PYUP_API_KEY="" pipenv check && -#RUN pipenv run pytest - -# Cleanup test packages. We want to use pipenv uninstall --all-dev but that command is -# broken. See: https://github.com/pypa/pipenv/issues/3722 -RUN pipenv --rm && \ - PIPENV_VENV_IN_PROJECT=1 pipenv --three && \ - pipenv sync - -# --- BUILD IMAGE --- -FROM base AS build-image WORKDIR /code -COPY --from=compile-image "/code/linkage_checker.egg-info/" "/code/linkage_checker.egg-info/" -COPY --from=compile-image "/code/linkage_checker" "/code/linkage_checker" -COPY --from=compile-image /code/.venv /code/.venv - # Make sure we use the virtualenv: ENV PATH="/code/.venv/bin:$PATH"