Skip to content

Commit

Permalink
Update base image (#120)
Browse files Browse the repository at this point in the history
* fix: update Satosa base to Alping 3.19.1

* fix: update Django base to Alpine 3.19.1

* fix: healthcheck

* fix: automatic package lib folder linking

---------

Co-authored-by: Salvatore Laiso <salvatore.laiso@it.ey.com>
  • Loading branch information
salvatorelaiso and Salvatore Laiso authored Feb 7, 2024
1 parent 22d05ba commit c5952d4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ services:
networks:
- satosa-saml2spid
healthcheck:
test: curl --fail http://localhost/SAML2IDP/metadata || exit 1
interval: 2s
test: wget -O - https://satosa-nginx/Saml2IDP/metadata --no-check-certificate || exit 1
interval: 30s
retries: 10
start_period: 10s
timeout: 10s
start_period: 30s
timeout: 30s

satosa-nginx:
image: nginx:alpine
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19.1

# Metadata params
ARG BUILD_DATE
Expand Down Expand Up @@ -32,10 +32,12 @@ COPY requirements.txt /

ENV BASEDIR="/satosa_proxy"

RUN apk add --update xmlsec libffi-dev openssl-dev python3 py3-pip python3-dev procps git openssl build-base gcc wget bash jq yq \
&& pip3 install --upgrade pip setuptools --root-user-action=ignore \
&& pip3 install -r requirements.txt --ignore-installed --root-user-action=ignore \
&& mkdir $BASEDIR
RUN apk add --update xmlsec libffi-dev openssl-dev python3 py3-pip python3-dev procps git openssl build-base gcc wget bash jq yq

ENV BASEDIR="/satosa_proxy"

RUN python3 -m venv .venv && . .venv/bin/activate && pip3 install --upgrade pip setuptools \
&& pip3 install -r requirements.txt --ignore-installed --root-user-action=ignore && mkdir $BASEDIR

RUN pip list

Expand Down
4 changes: 3 additions & 1 deletion example/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
. /.venv/bin/activate

# get IDEM MDQ key
if [[ $GET_IDEM_MDQ_KEY == true ]]; then
Expand All @@ -7,4 +8,5 @@ if [[ $GET_IDEM_MDQ_KEY == true ]]; then
echo "Downloaded IDEM MDQ key"
fi

uwsgi --ini /satosa_proxy/uwsgi_setup/uwsgi/uwsgi.ini.docker
wsgi_file=/.venv/lib/$(python -c 'import sys; print(f"python{sys.version_info.major}.{sys.version_info.minor}")')/site-packages/satosa/wsgi.py
uwsgi --ini /satosa_proxy/uwsgi_setup/uwsgi/uwsgi.ini.docker --wsgi-file $wsgi_file
1 change: 0 additions & 1 deletion example/uwsgi_setup/uwsgi/uwsgi.ini.docker
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ processes = 8
# sets max connections to
listen = 2048

wsgi-file = /usr/lib/python3.11/site-packages/satosa/wsgi.py
callable = app

log-master-bufsize = 128000
Expand Down
10 changes: 4 additions & 6 deletions example_sp/django.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19.1

RUN apk update
RUN apk add --update --no-cache tzdata
Expand All @@ -11,9 +11,7 @@ COPY example_sp/entrypoint.sh /

WORKDIR /djangosaml2_sp

RUN apk add --update xmlsec-dev libffi-dev openssl-dev python3 py3-pip python3-dev procps git openssl build-base gcc wget bash jq yq \
&& pip3 install --upgrade pip setuptools --root-user-action=ignore
RUN apk add --update xmlsec-dev libffi-dev openssl-dev python3 py3-pip python3-dev procps git openssl build-base gcc wget bash jq yq

RUN pip list

RUN pip3 install -r ../requirements.txt --ignore-installed --root-user-action=ignore
RUN python3 -m venv .venv && . .venv/bin/activate && pip3 install --upgrade pip setuptools \
&& pip3 install -r ../requirements.txt --ignore-installed --root-user-action=ignore
1 change: 1 addition & 0 deletions example_sp/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
. /djangosaml2_sp/.venv/bin/activate
python -B manage.py migrate
python -B manage.py runserver 0.0.0.0:8000

0 comments on commit c5952d4

Please sign in to comment.