Build & publish docker image

This commit is contained in:
Cédric COURALET 2023-10-10 13:28:03 +02:00
parent cfc0fe42b7
commit 0b2b2e6e33
3 changed files with 51 additions and 11 deletions

View File

@ -2,14 +2,19 @@ kind: pipeline
name: Build & publish main
steps:
# Build mkdocs website
- name: build
image: squidfunk/mkdocs-material
commands:
- mkdocs build --site-dir public
#Publish
- name: publish
image: python:latest
commands:
- ls -alR public
- name: publish-image
pull: always
image: plugins/kaniko:1.7.1-kaniko1.9.1
settings:
auto_tag: true
auto_tag_suffix: latest
registry: code.groupe-genes.fr
repo: code.groupe-genes.fr/dsit/documentation-dsit
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
exclude:
- pull_request

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM squidfunk/mkdocs-material as build
ADD mkdocs.yml .
ADD ./docs ./docs
RUN ls -al
RUN mkdocs build --site-dir /public
FROM httpd:2.4-bookworm
RUN apt update -y && apt install -y --no-install-recommends libapache2-mod-auth-openidc
RUN echo "Include conf/extra/httpd-custom-oidc.conf" >> /usr/local/apache2/conf/httpd.conf
ADD ./httpd-custom-oidc.conf /usr/local/apache2/conf/extra/
COPY --from=build /public /usr/local/apache2/htdocs/

23
httpd-custom-oidc.conf Normal file
View File

@ -0,0 +1,23 @@
LoadModule auth_openidc_module /usr/lib/apache2/modules/mod_auth_openidc.so
<IfModule auth_openidc_module>
OIDCProviderIssuer https://auth.groupe-genes.fr/realms/ensae
OIDCProviderAuthorizationEndpoint https://auth.groupe-genes.fr/realms/ensae/protocol/openid-connect/auth
OIDCProviderJwksUri https://auth.groupe-genes.fr/realms/ensae/protocol/openid-connect/certs
OIDCProviderTokenEndpoint https://auth.groupe-genes.fr/realms/ensae/protocol/openid-connect/token
OIDCProviderUserInfoEndpoint https://auth.groupe-genes.fr/realms/ensae/protocol/openid-connect/userinfo
OIDCSSLValidateServer On
OIDCRedirectURI http://${SERVER_NAME}/oidc_redirect_uri
OIDCCryptoPassphrase gfdgfd
OIDCClientID ${OIDC_CLIENT}
OIDCClientSecret ${OIDC_SECRET}
OIDCRemoteUserClaim preferred_username
OIDCInfoHook userinfo
</IfModule>
<Location />
AuthType openid-connect
Require valid-user
</Location>