-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
54 lines (43 loc) · 1.82 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM --platform=$BUILDPLATFORM php:8.2-apache
RUN apt-get update && \
apt-get -y install apt-transport-https git curl vim --no-install-recommends && \
rm -r /var/lib/apt/lists/* && \
curl -sSL -o /tmp/mo https://git.io/get-mo && \
chmod +x /tmp/mo
# Docker build
ARG GIT_REVISION=unkown
ARG GIT_ORIGIN=unkown
ARG IMAGE_NAME=unkown
LABEL git-revision=$GIT_REVISION \
git-origin=$GIT_ORIGIN \
image-name=$IMAGE_NAME \
maintainer="Tadayuki Onishi <[email protected]>"
# SimpleSAMLphp
ARG SIMPLESAMLPHP_VERSION
RUN curl -sSL -o /tmp/simplesamlphp.tar.gz https://github.com/simplesamlphp/simplesamlphp/releases/download/v$SIMPLESAMLPHP_VERSION/simplesamlphp-$SIMPLESAMLPHP_VERSION.tar.gz && \
tar xzf /tmp/simplesamlphp.tar.gz -C /tmp && \
mv /tmp/simplesamlphp-* /var/www/simplesamlphp && \
touch /var/www/simplesamlphp/modules/exampleauth/enable
COPY config/simplesamlphp/config.php /var/www/simplesamlphp/config
COPY config/simplesamlphp/authsources.php /var/www/simplesamlphp/config
COPY config/simplesamlphp/saml20-sp-remote.php /var/www/simplesamlphp/metadata
COPY config/simplesamlphp/server.crt /var/www/simplesamlphp/cert/
COPY config/simplesamlphp/server.pem /var/www/simplesamlphp/cert/
RUN echo "<?php" > /var/www/simplesamlphp/metadata/shib13-sp-remote.php
# Apache
ENV HTTP_PORT 8080
COPY config/apache/ports.conf.mo /tmp
COPY config/apache/simplesamlphp.conf.mo /tmp
RUN /tmp/mo /tmp/ports.conf.mo > /etc/apache2/ports.conf && \
/tmp/mo /tmp/simplesamlphp.conf.mo > /etc/apache2/sites-available/simplesamlphp.conf
# hadolint ignore=DL3059
RUN a2dissite 000-default.conf default-ssl.conf && \
a2enmod rewrite && \
a2ensite simplesamlphp.conf
# Clean up
# hadolint ignore=DL3059
RUN rm -rf /tmp/*
# Set work dir
WORKDIR /var/www/simplesamlphp
# General setup
EXPOSE ${HTTP_PORT}