Commit d98ce95d authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added Dockerfiles and Docker Compose demo

parent e0af25e4
Loading
Loading
Loading
Loading

Dockerfile

deleted100644 → 0
+0 −57
Original line number Diff line number Diff line
FROM ubuntu:18.10

# To fix "configuring tzdata" interactive input during apt install
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -yq --no-install-recommends \
    apache2 \
    libapache2-mod-php7.2 \
    php7.2-xml \
    php7.2-mbstring \
    php-mysql \
    php-curl \
    libapache2-mod-shib2 \
    make \
    wget \
    ca-certificates \
    ssl-cert \
    vim

# Copying Shibboleth SP configuration
COPY docker/shibboleth/shibboleth2.xml /etc/shibboleth/
COPY docker/shibboleth/sp-key.pem /etc/shibboleth/
COPY docker/shibboleth/sp-cert.pem /etc/shibboleth/
    
# Installing Embedded Discovery Service
WORKDIR /usr/local/src

RUN wget https://shibboleth.net/downloads/embedded-discovery-service/1.2.1/shibboleth-embedded-ds-1.2.1.tar.gz -O shibboleth-eds.tar.gz
RUN tar xzf shibboleth-eds.tar.gz

WORKDIR shibboleth-embedded-ds-1.2.1
RUN make install

RUN mv /etc/shibboleth-ds/shibboleth-ds.conf /etc/apache2/conf-available/shibboleth-ds.conf
RUN sed -i 's/Allow from All/Require all granted/g' /etc/apache2/conf-available/shibboleth-ds.conf
RUN a2enconf shibboleth-ds.conf

# Adding RAP Apache configuration
COPY docker/rap.conf /etc/apache2/conf-available/
RUN a2enconf rap.conf

# Enable mod_rewrite (for Flight framework)
RUN a2enmod rewrite
RUN a2enmod ssl
RUN a2ensite default-ssl

# Copying RAP php files
WORKDIR /var/www/html
COPY . rap-ia2

WORKDIR /var/www/html/rap-ia2
RUN mkdir -p logs
RUN chown -R www-data logs

# Starting shibd & Apache
CMD service shibd start && apachectl -D FOREGROUND

docker/Dockerfile

0 → 100644
+30 −0
Original line number Diff line number Diff line
FROM git.ia2.inaf.it:5050/ia2/rap-ia2/composer

FROM git.ia2.inaf.it:5050/ia2/rap-ia2/base

# add RAP Apache configuration
COPY docker/rap.conf /etc/apache2/conf-available/
RUN a2enconf rap.conf

# enable mod_rewrite and mod_headers (for Flight framework)
RUN a2enmod rewrite
RUN a2enmod headers

ARG RAP_DIR=/var/www/html/rap-ia2/

# create RAP directory
RUN mkdir $RAP_DIR
COPY --from=0 /rap-ia2 $RAP_DIR

WORKDIR $RAP_DIR

# create logs directory
RUN mkdir -p logs

RUN chown -R www-data $RAP_DIR

# allow apache2 to stop gracefully
STOPSIGNAL SIGWINCH

EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]

docker/base-Dockerfile

0 → 100644
+15 −0
Original line number Diff line number Diff line
# Base Docker image for running RAP inside Apache server

FROM debian:buster

RUN apt-get update && \
    apt-get install -yq --no-install-recommends \
    apache2 \
    libapache2-mod-php \
    php-xml \
    php-mbstring \
    php-mysql \
    php-curl \
    php-yaml \
    ca-certificates \
    ssl-cert
+34 −0
Original line number Diff line number Diff line
# Docker image containing composer and RAP source code

FROM debian:buster

RUN apt-get update && \
    apt-get install -yq --no-install-recommends \
    php-zip php-yaml php-curl php-xml php-mysql \
    composer git unzip

COPY composer* /rap-ia2/

WORKDIR /rap-ia2

RUN composer install --no-dev --no-autoloader

# copy RAP php files
COPY auth /rap-ia2/auth
COPY classes /rap-ia2/classes
COPY css /rap-ia2/css
COPY exec /rap-ia2/exec
COPY img /rap-ia2/img
COPY include /rap-ia2/include
COPY js /rap-ia2/js
COPY service-logos /rap-ia2/service-logos
COPY views /rap-ia2/views
COPY config-example.yaml index.php version.txt .htaccess /rap-ia2/

RUN composer install --no-dev

COPY tests /rap-ia2/tests

ARG INCLUDE_TESTS=false

RUN if [ "$INCLUDE_TESTS" = 'true' ]; then composer install; else rm -Rf /rap-ia2/tests; fi
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@ FROM mariadb:10.5

ENV MYSQL_ALLOW_EMPTY_PASSWORD yes
ENV MYSQL_DATABASE rap
ENV MYSQL_USER rap
ENV MYSQL_PASSWORD rap

COPY sql/setup-database.sql /docker-entrypoint-initdb.d/01-setup-database.sql
COPY sql/delete-user-procedure.sql /docker-entrypoint-initdb.d/02-delete-user-procedure.sql
Loading