Skip to content

Commit

Permalink
Update CI workflow + Docker-compose (review 3.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidelongo-ey committed Dec 18, 2023
1 parent d81413e commit 7ccdc5d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
!example_sp
!requirements.txt
!oids.conf
!build_spid_certs.sh
!build_spid_certs.sh
8 changes: 4 additions & 4 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ jobs:
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics example
## exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 --max-line-length 120 --count --exit-zero --statistics example
- name: Create docker-example folder
run: |
mkdir -p docker-example
cp -r example/. docker-example
- name: docker compose
run: |
cd Docker-compose
docker compose -f docker-compose.yml up -d
- name: djangosaml2 SP metadata to Proxy
run: |
wget http://localhost:8000/saml2/metadata -O example/metadata/sp/djangosaml2_sp.xml
- name: Create docker-example folder
run: |
mkdir -p docker-example
cp -r example/. docker-example
- name: run satosa-saml2spid
run: |
cd docker-example
Expand Down
43 changes: 20 additions & 23 deletions Docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: '3'
services:

satosa-mongo:
image: mongo
container_name: satosa-mongo
Expand Down Expand Up @@ -32,7 +31,25 @@ services:
ME_CONFIG_MONGODB_URL: mongodb://${MONGO_DBUSER}:${MONGO_DBPASSWORD}@satosa-mongo:27017/
networks:
- satosa-saml2spid

## START: PARTE NUOVA
django_sp:
build:
context: ../
args:
- NODE_ENV=local
dockerfile: example_sp/django.Dockerfile
container_name: django_sp
#restart: always
working_dir: /django_sp
entrypoint: "sh ../entrypoint.sh"
volumes:
- /usr/share/zoneinfo/Europe/Rome:/etc/localtime:ro
- ../example_sp/djangosaml2_sp:/django_sp:rw
ports:
- "8000:8000"
networks:
- satosa-saml2spid
## END: PARTE NUOVA
satosa-saml2spid:
#image: ghcr.io/italia/satosa-saml2spid:latest
#image: satosa-saml2spid:latest
Expand Down Expand Up @@ -113,26 +130,6 @@ services:
networks:
- satosa-saml2spid


django_sp:
build:
context: ../
args:
- NODE_ENV=local
dockerfile: example_sp/django.Dockerfile
container_name: django_sp
#restart: always
working_dir: /django_sp
entrypoint: "sh ./entrypoint.sh"
volumes:
- /usr/share/zoneinfo/Europe/Rome:/etc/localtime:ro
- ../example_sp:/django_sp:rw
ports:
- "8000:8000"
networks:
- satosa-saml2spid


spid-samlcheck:
image: italia/spid-saml-check
container_name: spid-samlcheck
Expand All @@ -153,4 +150,4 @@ volumes:

networks:
satosa-saml2spid:
name: satosa-saml2spid
name: satosa-saml2spid
16 changes: 8 additions & 8 deletions example_sp/django.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM alpine:3.18
ENV BASEDIR="/django_sp"
RUN apk update
RUN apk add --update --no-cache tzdata
RUN cp /usr/share/zoneinfo/Europe/Rome /etc/localtime
RUN echo "Europe/Rome" > /etc/timezone
RUN apk del tzdata

COPY djangosaml2_sp/requirements.txt /

COPY example_sp/djangosaml2_sp/requirements.txt /
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 \
&& pip3 install virtualenv

&& pip3 install --upgrade pip setuptools --root-user-action=ignore

RUN pip list
WORKDIR $BASEDIR/


RUN pip3 install -r ../requirements.txt --ignore-installed --root-user-action=ignore
5 changes: 2 additions & 3 deletions example_sp/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pip3 install -r ../requirements.txt --ignore-installed --root-user-action=ignore
cd djangosaml2_sp
python -B ./manage.py runserver 0.0.0.0:8000
python -B manage.py migrate
python -B manage.py runserver 0.0.0.0:8000
5 changes: 3 additions & 2 deletions satosa.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LABEL org.opencontainers.image.authors=$AUTHORS \
org.opencontainers.image.source=$VCS_URL \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.description="Docker Image di Satosa-Saml2Spid."

RUN apk update
RUN apk add --update --no-cache tzdata
RUN cp /usr/share/zoneinfo/Europe/Rome /etc/localtime
Expand All @@ -29,6 +29,7 @@ RUN apk add mailcap

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 \
Expand All @@ -38,4 +39,4 @@ RUN apk add --update xmlsec libffi-dev openssl-dev python3 py3-pip python3-dev p

RUN pip list

WORKDIR $BASEDIR/
WORKDIR $BASEDIR/

0 comments on commit 7ccdc5d

Please sign in to comment.