From e12459bd3f47c1550259375ad7ba7be3b1a581b0 Mon Sep 17 00:00:00 2001 From: Timothy Hobbs Date: Sun, 21 Jul 2024 21:42:03 +0200 Subject: [PATCH] Remove insecure development Dockerfile in favor of "standalone" Dockerfile --- Dockerfile | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 55ab90ff..00000000 --- a/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -ARG PYTHON_VERSION=3.11.5-slim-bookworm - -# define an alias for the specfic python version used in this file. -FROM python:${PYTHON_VERSION} as python - -FROM python as python-build-stage - -# Install apt packages -RUN apt-get update && apt-get install --no-install-recommends -y \ - # dependencies for building Python packages - build-essential - -# Requirements are installed here to ensure they will be cached. -COPY ./requirements.txt ./requirements-dev.txt / - -# Create Python Dependency and Sub-Dependency Wheels -RUN pip install packaging -RUN pip wheel --wheel-dir /usr/src/app/wheels \ - -r requirements.txt \ - -r requirements-dev.txt - -FROM python as python-run-stage - -ARG APP_HOME=/app - -ENV PYTHONUNBUFFERED 1 -ENV PYTHONDONTWRITEBYTECODE 1 - -WORKDIR ${APP_HOME} - -COPY --from=python-build-stage /usr/src/app/wheels /wheels/ - -# use wheels to install python dependencies -RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \ - && rm -rf /wheels/ - -COPY ./entrypoint /entrypoint -RUN sed -i 's/\r$//g' /entrypoint && chmod +x /entrypoint - -FROM python-run-stage AS backend - -# copy application code to WORKDIR -COPY . ${APP_HOME} - -ENTRYPOINT ["/entrypoint"] -CMD ["python3", "demo/manage.py", "runserver", "--noreload", "0.0.0.0:8080"]