Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to no-wheelhouse base image #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
FROM praekeltfoundation/django-bootstrap:py3.6
FROM ghcr.io/praekeltfoundation/docker-django-bootstrap-nw:py3.9-bullseye as builder

COPY ./requirements.txt /app/
COPY ./setup.py /app/
RUN apt-get-install.sh build-essential libpq-dev

RUN pip install -r /app/requirements.txt
COPY setup.py requirements.txt ./

# Remove the pip config to re-enable caching.
RUN rm /etc/pip.conf
RUN pip install -e .
RUN mkdir /wheels
# Copy any binary wheels we've built into /wheels for installation in the
# runtime image.
RUN for f in $(find /root/.cache/pip/wheels -type f | grep -v 'none-any.whl$'); do cp $f /wheels/; done


FROM ghcr.io/praekeltfoundation/docker-django-bootstrap-nw:py3.9-bullseye

COPY . /app

COPY --from=builder /wheels /wheels
RUN pip install -f /wheels -e .

# temporary untill there is a new PyCap Release
ENV DJANGO_SETTINGS_MODULE "config.settings.production"
RUN SECRET_KEY=placeholder ALLOWED_HOSTS=placeholder python manage.py collectstatic --noinput
CMD ["config.wsgi:application"]
CMD ["config.wsgi:application"]