-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
30 lines (21 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM registry.suse.com/bci/python:3.11
COPY requirements.txt /pcw/
RUN source /etc/os-release && zypper addrepo -G -cf "https://download.opensuse.org/repositories/SUSE:/CA/$VERSION_ID/SUSE:CA.repo" && \
zypper -n in ca-certificates-suse gcc libffi-devel && \
pip install --no-cache-dir wheel && pip install --no-cache-dir -r /pcw/requirements.txt && zypper clean && rm -rf /var/cache
# Copy program files only
COPY ocw /pcw/ocw/
COPY webui /pcw/webui/
COPY containers/container-startup manage.py LICENSE /pcw/
WORKDIR /pcw
# Run basic system check to ensure a healthy container
RUN ["/pcw/container-startup", "check"]
## Finalize ################################################################# ##
VOLUME /pcw/db
EXPOSE 8000/tcp
# Required to use system certs in python-requests
ENV REQUESTS_CA_BUNDLE=/etc/ssl/ca-bundle.pem
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 UWSGI_WSGI_FILE=/pcw/webui/wsgi.py UWSGI_MASTER=1
ENV UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy
# Once we are certain that this runs nicely, replace this with ENTRYPOINT.
ENTRYPOINT ["/pcw/container-startup", "run"]