Skip to content
Snippets Groups Projects
Commit aa3aa31b authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Started Dockerization

parent 1e5c3a27
No related branches found
No related tags found
No related merge requests found
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 \
vim
# Copying Shibboleth SP configuration
COPY docker/shibboleth2.xml /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
# 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 Apache
CMD apachectl -D FOREGROUND
...@@ -17,7 +17,7 @@ abstract class BaseMySQLDAO { ...@@ -17,7 +17,7 @@ abstract class BaseMySQLDAO {
*/ */
public function getDBHandler(): PDO { public function getDBHandler(): PDO {
$config = $this->locator->config->databaseConfig; $config = $this->locator->config->databaseConfig;
$connectionString = "mysql:host=" . $config->hostname . ";dbname=" . $config->dbname; $connectionString = "mysql:host=" . $config->hostname . ";port=" . $config->port . ";dbname=" . $config->dbname;
$dbh = new PDO($connectionString, $config->username, $config->password); $dbh = new PDO($connectionString, $config->username, $config->password);
// For transaction errors (see https://stackoverflow.com/a/9659366/771431) // For transaction errors (see https://stackoverflow.com/a/9659366/771431)
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
......
CREATE DATABASE rap;
CREATE USER rap@'%' IDENTIFIED BY 'rap123';
GRANT ALL PRIVILEGES ON rap.* TO rap@'%';
USE rap;
FROM mariadb:10.4
ENV MYSQL_ROOT_PASSWORD=root
ADD docker/db/event.cnf /etc/mysql/conf.d/
ADD docker/db/1-user.sql /docker-entrypoint-initdb.d/
ADD sql/setup-database.sql /docker-entrypoint-initdb.d/
RUN sed -i.old '1s;^;USE rap\;\n;' /docker-entrypoint-initdb.d/setup-database.sql
[mysqld]
event_scheduler=1
<Directory /var/www/html/rap-ia2/>
AllowOverride All
</Directory>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment