I most likely only need a hint into the right direction.
I have a docker container running a Django app using gunicorn and nginx. This Django app is currently getting its environment variables from a .env file.
FROM python:alpine
EXPOSE 8000
RUN apk update
RUN apk add --no-cache git gcc musl-dev libffi-dev libxml2-dev libxslt-dev gcc swig g++
RUN apk add --no-cache jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff- dev tk-dev tcl-dev
RUN apk add --no-cache bash ffmpeg libmagic
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade setuptools
RUN mkdir /opt/app
WORKDIR /opt/app
COPY . .
RUN python3 -m pip install /root/d12f/
RUN pip3 install -r requirements.txt
RUN pip3 install gunicorn
CMD sh -c 'gunicorn --conf python:app.gunicorn_conf app.wsgi --bind 0.0.0.0:8000 --reload --log-level info --access-logfile - --timeout 360 --error-logfile -'
Of course there is no .env file in the repo as this would be a security risk.
The Docker image is being created by github and stored in a private GitHub Package. Later on this docker image is being used to run on Kubernetes.
I'm trying to find the best solution to put an .env file into
/opt/app/app/.env
as a local file.
I would prefer not to use global environment variables, if possible.
Thanks for any suggestion.