diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 40 |
1 files changed, 15 insertions, 25 deletions
@@ -1,30 +1,20 @@ -# Pull base image -FROM python:3.12-alpine +FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218 -WORKDIR /app - -RUN apk add --no-cache \ - build-base \ - curl \ - && adduser -D python \ - && mkdir -p /app \ - && chown python:python /app - -USER python +# Add application sources with correct permissions for OpenShift +USER 0 +COPY . /app +RUN mkdir -p /app/static/css /app/static/js /app/static/img +RUN chown -R 1001:0 /app +USER 1001 -COPY --chown=python:python requirements*.txt ./ - -RUN pip install -r requirements.txt \ - && pip install -r requirements_dev.txt - -COPY --chown=python:python . . +WORKDIR /app -ENV DEBUG="${DEBUG}" \ - PYTHONUNBUFFERED="true" \ - PATH="${PATH}:/home/python/.local/bin" \ - USER="python" -# Collect static files -RUN SECRET_KEY=nothing python manage.py collectstatic --no-input +# Install the dependencies +RUN pip install -U "pip>=19.3.1" && \ + pip install -r requirements.txt && \ + python manage.py collectstatic --noinput && \ + python manage.py migrate -CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] +# Run the application +CMD python manage.py runserver 0.0.0.0:8080
\ No newline at end of file |