[ipv6ula] update Docker image

This commit is contained in:
kjg 2025-06-04 05:03:39 +00:00
commit 7efdd60643
4 changed files with 65 additions and 1 deletions

50
Dockerfile Normal file
View file

@ -0,0 +1,50 @@
FROM docker.io/python:3.12.10-alpine3.21
ENV \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
# python:
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PYTHONDONTWRITEBYTECODE=1
RUN apk add --update --no-cache zlib-dev libxml2-dev libxslt-dev libmemcached-dev \
build-base gcc make alpine-sdk musl-dev postgresql-dev openldap-dev \
py3-distutils-extra py3-distutils-extra-pyc shadow python3-dev linux-headers pcre-dev
ENV VIRTUAL_ENV=/venv
ENV DJANGO_CONFIGURATION=production
ENV \
# pip:
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100
RUN pip install --upgrade pip wheel
RUN python3 -m venv $VIRTUAL_ENV
COPY requirements.txt .
RUN . /venv/bin/activate && pip install -r requirements.txt
RUN mkdir -p /app
COPY ./ /app/
WORKDIR /app
RUN . /venv/bin/activate && \
DJANGO_SECRET_KEY=dummy \
DJANGO_STATIC_ROOT=/app/static ./manage.py collectstatic --no-input
RUN groupadd --gid 1001 app \
&& useradd --home-dir /app --shell /bin/bash --gid app --uid 1001 app
RUN chown -R app:app ./
USER app
ENV PATH="/venv/bin:$PATH"

View file

@ -140,7 +140,7 @@ USE_TZ = True
STATIC_URL = '/static/'
STATICFILES_DIRS = [ ]
STATIC_ROOT = "/home/app/app/static"
STATIC_ROOT = "/app/static"
AUTHENTICATION_BACKENDS = [

View file

@ -2,3 +2,5 @@ django==3.1.4
django-auth-ldap
psycopg2
django-crispy-forms
setuptools
uwsgi

12
uwsgiconfig/app.ini Normal file
View file

@ -0,0 +1,12 @@
[uwsgi]
socket = /app/uwsgi/uwsgi.sock
chdir = /app
venv = /venv
wsgi-file = ipv6ula/wsgi.py
processes = 4
threads = 2
chmod-socket = 666
vacuum = true
plugins = python3
uid = app
gid = app