Skip to content

Commit 88587c5

Browse files
rootkyre6371
authored andcommitted
Changes for python3.11 env, and Django 5.2
1 parent 200eef5 commit 88587c5

3 files changed

Lines changed: 52 additions & 17 deletions

File tree

Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
# Use Python 3.9 as the base image
2-
FROM python:3.9-slim
1+
# Use Python 3.11 as the base image
2+
FROM python:3.11-slim
33

44
# Define gosu version
55
ARG GOSU_VERSION=1.16
66

77
# Install system dependencies
88
RUN apt-get update && apt-get install -y \
99
gnupg2 \
10+
xz-utils \
11+
dpkg \
12+
which \
13+
sssd \
14+
libpam0g-dev \
15+
libsqlite3-dev \
16+
libssl-dev \
17+
python3-dev \
18+
libldap2-dev \
19+
default-libmysqlclient-dev \
1020
curl \
1121
lsb-release \
1222
ca-certificates \
@@ -52,10 +62,6 @@ RUN pip install --upgrade pip && \
5262
pip install wheel && \
5363
pip install -r requirements.txt
5464

55-
# fix dep issues
56-
RUN sed -i '/from django.utils import timezone/a from pytz import utc\ntimezone.utc = utc' /opt/rcamp_venv/lib/python3.9/site-packages/ldapdb/models/fields.py
57-
RUN sed -i 's/from django.conf.urls import url/from django.urls import re_path as url/' /opt/rcamp_venv/lib/python3.9/site-packages/grappelli/urls.py
58-
5965
# Clone and install the django-ldapdb-test-env repository
6066
WORKDIR /opt/rcamp
6167

docker-compose.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11

22
services:
33
rcamp-uwsgi:
4+
image: rcamp-uwsgi2
45
build:
56
context: .
67
container_name: rcamp-uwsgi
7-
command: ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
8+
hostname: ${HOSTNAME}
9+
#command: ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
810
env_file:
9-
- dev-environment.env
11+
- .env
1012
environment:
1113
- UWSGI_UID=${UWSGI_UID}
1214
- UWSGI_GID=${UWSGI_GID}
1315
volumes:
1416
- ./rcamp:/opt/rcamp
1517
- ./ldapdb:/opt/ldapdb
16-
- static-content:/opt/static
17-
- media-uploads:/opt/media
18-
- rcamp-logs:/opt/logs
19-
ports:
20-
- "80:8000"
21-
- "5678:5678" # Debugger port
18+
- /var/lib/sss/pipes:/var/lib/sss/pipes:rw
19+
- ./rcamp-pam/nsswitch.conf:/etc/nsswitch.conf
20+
- ./rcamp-pam/pam.d:/etc/pam.d
21+
- ./rcamp-pam/raddb:/etc/raddb
22+
- ./static-content:/opt/static
23+
- ${MEDIA_DIR}:/opt/media
24+
- ./rcamp-logs:/opt/logs
25+
# ports:
26+
# - "80:8000"
27+
# - "443:443"
28+
#- "5678:5678" # Debugger port
2229
depends_on:
2330
database:
2431
condition: service_healthy
32+
logging:
33+
driver: syslog
2534

2635
database:
2736
image: mysql:8.4
@@ -37,6 +46,26 @@ services:
3746
timeout: 5s
3847
retries: 5
3948

49+
nginx:
50+
hostname: ${HOSTNAME}
51+
image: nginx:1.20.0
52+
container_name: nginx
53+
volumes:
54+
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
55+
- ./nginx/uwsgi_params:/etc/nginx/uwsgi_params:ro
56+
- ${SSL_CERT}:/etc/nginx/certs/rcamp.crt:ro
57+
- ${SSL_KEY}:/etc/nginx/certs/rcamp.key:ro
58+
- ${MEDIA_DIR}:/var/www/media:ro
59+
- ./static-content:/var/www/static:ro
60+
- ./nginx-logs:/var/logs/nginx
61+
ports:
62+
- "80:80"
63+
- "443:443"
64+
logging:
65+
driver: syslog
66+
depends_on:
67+
- rcamp-uwsgi
68+
4069
volumes:
4170
static-content:
4271
media-uploads:

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ asgiref==3.8.1
22
certifi==2025.1.31
33
charset-normalizer==3.4.1
44
debugpy==1.8.13
5-
Django==4.2.20
5+
Django==5.2
66
django-auth-ldap==5.1.0
77
django-crispy-forms==1.13.0
88
django-easy-pjax==1.2.0
99
django-extensions==3.2.3
1010
django-filter==22.1
1111
django-grappelli==4.0.1
12-
django-ldapdb @ git+https://github.com/django-ldapdb/django-ldapdb.git@eb9503c85cd230f45765ec8fcd9fc21dbc81ce4c
12+
django-ldapdb @ git+https://oauth2:glpat-T4wkcqXufHvA53DClNJp_W86MQp1OjE5CA.01.0y13pb1es@gitlab.rc.int.colorado.edu/rc-ops/django-ldap-rc.git@feature/python3.11-update
1313
django-material==1.11.3
1414
django-mysql==4.16.0
1515
django-utils==0.0.2
@@ -31,4 +31,4 @@ six==1.16.0
3131
sqlparse==0.5.3
3232
typing_extensions==4.12.2
3333
urllib3==2.3.0
34-
uWSGI==2.0.20
34+
uWSGI==2.0.31

0 commit comments

Comments
 (0)