# The first instruction is what image we want to base our container on # We Use an official Python runtime as a parent image FROM python:3.9 # The enviroment variable ensures that the python output is set straight # to the terminal with out buffering it first ENV PYTHONUNBUFFERED 1 # Not forcing anybody's hand here, just a bunch of packages that could become useful soon RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y nginx supervisor sqlite3 mariadb-client nodejs rsync && \ pip3 install -U pip setuptools && \ rm -rf /var/lib/apt/lists/* # Set the working directory to /OACCT_checker WORKDIR /oacct_checker #RUN chown 1001 /oacct_checker # Copy the current directory contents into the container at /OACCT_checker ADD . /oacct_checker/ # Install any needed packages specified in requirements.txt RUN pip install -r requirements.txt #frontend with node js # RUN npm install # # build app for production # RUN npm run build COPY . /oacct_checker/ RUN chown -R 1001 /oacct_checker # Permissions as per https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines RUN chgrp -R 0 /oacct_checker && \ chmod -R g=u /oacct_checker #User at the end to avoid access error during building process USER 1001 CMD /bin/bash -c 'python3 manage.py runserver 0.0.0.0:8080' # CMD /bin/bash -c 'python3 manage.py collectstatic --noinput && python3 manage.py runserver 0.0.0.0:8080' # test with static files # PermissionError: [Errno 13] Permission denied: '/oacct_checker/staticfiles' # 15.03.2021 new error PermissionError: [Errno 1] Operation not permitted # CMD /bin/bash -c 'python3 manage.py collectstatic --noinput && python3 manage.py runserver 0.0.0.0:8080' #test with npm run build --> npm not found