-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
42 lines (36 loc) · 1.09 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
31
32
33
34
35
36
37
38
39
40
41
42
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
WORKDIR /app
ENV STATIC_ROOT /srv/app/static
COPY . .
USER root
RUN TZ="Europe/Helsinki" && \
yum -y update && \
yum install -y nano \
libffi-devel \
gcc \
python3 \
python3-devel \
python3-pip \
postgresql \
postgresql-devel \
libpq-devel \
unzip \
bash \
grep \
cronie \
libcap && \
# Install pip packages (uwsgi) instead of using yum
pip install uwsgi && \
# Ensure pip and python are accessible globally
ln -s /usr/bin/pip3 /usr/local/bin/pip && \
ln -s /usr/bin/python3 /usr/local/bin/python && \
# Install Python project dependencies
pip install --no-cache-dir -r requirements.txt && \
# Collect static files using Django settings
mkdir -p /srv/app/static && \
DJANGO_SECRET_KEY="only-used-for-collectstatic" DATABASE_URL="sqlite:///" \
python manage.py collectstatic --noinput && \
chmod +x /app/sync-from-sap.sh
# Set user to nobody and group 0, to match OpenShift's UID/GID setup
USER nobody:0
ENTRYPOINT ["./docker-entrypoint.sh"]