trying to setup the django testing image

This commit is contained in:
2026-03-16 10:39:26 +00:00
parent ca3f7e964e
commit 7127effdaf
3 changed files with 88 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# Stage 1: Build the module
FROM python:3
ENV PYTHONUNBUFFERED 1
WORKDIR /code/
# Install build tools and MaxMind library
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/apt/lists/*
# Clone the specific GeoIP2 module project
RUN git clone https://gitea.tryton.geeraert.eu/pi-ux-ce/Django_kube.git
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade pip
RUN pip list --cache-dir=/opt/hostedtoolcache/pip --outdated
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade wheel
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade setuptools
RUN pip install --cache-dir=/opt/hostedtoolcache/pip -r Django_kube/requirements.txt
RUN python Django_kube/django_code/manage.py migrate
COPY entrypoint.sh /code/entrypoint.sh
RUN chmod +x /code/entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["/code/entrypoint.sh"]
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
cd Django_kube
#another methid but needs to rm -rf before
#git clone --depth 1 -b main https://gitea.tryton.geeraert.eu/pi-ux-ce/Django_kube.git
git pull
pip install -r requirements.txt
python django_code/manage.py migrate
python django_code/manage.py runserver "0.0.0.0:8000"