mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-03-11 13:38:18 +01:00
Remove insecure development Dockerfile in favor of "standalone" Dockerfile
This commit is contained in:
parent
325eaa6318
commit
e12459bd3f
46
Dockerfile
46
Dockerfile
@ -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"]
|
Loading…
Reference in New Issue
Block a user