Build docker image without pipenv dependency
MODIFY
Dockerfile
Dockerfile
FROM python:3.10-alpine3.13 AS base
-
WORKDIR /app
-ENTRYPOINT ["python", "-m", "plex_trakt_sync"]
# Install app depedencies
-RUN pip install --no-cache-dir pipenv
+FROM base AS build
+RUN pip install pipenv
COPY Pipfile* ./
-RUN pipenv install --system --deploy
+RUN pipenv install --deploy
+
+FROM base
+ENTRYPOINT ["python", "-m", "plex_trakt_sync"]
ENV \
PTS_CONFIG_DIR=/app/config \
@@ -17,7 +19,9 @@ ENV \
VOLUME /app/config
-# Copy rest of the app
+# Copy things together
COPY . .
+COPY --from=build /root/.local/share/virtualenvs/app-*/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
+
ARG APP_VERSION=$APP_VERSION
ENV APP_VERSION=$APP_VERSION
\ No newline at end of file

Build docker image without pipenv dependency