Skip to content

Commit bfac87e

Browse files
committed
Adding the Dockerfiles and config to build the container images
1 parent 0d986a4 commit bfac87e

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

docker/Dockerfile.dev

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM ghcr.io/openconext/openconext-basecontainers/php72-apache2-node14-composer2:latest
2+
3+
RUN rm -rf /etc/apache2/sites-enabled/*
4+
COPY ./docker/conf/selfservice-apache2.conf /etc/apache2/sites-enabled/selfservice.conf
5+
EXPOSE 80
6+
7+
# Set the default workdir
8+
WORKDIR /var/www/html
9+
10+
CMD ["apache2-foreground"]

docker/Dockerfile.prod

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ghcr.io/openconext/openconext-basecontainers/php72-apache2:latest AS php-build
2+
COPY *.tar.bz2 /tmp/
3+
RUN tar -xvjf /tmp/*.tar.bz2 -C /var/www/html/ && \
4+
rm -rf /tmp/*.tar.bz2
5+
6+
# Add the application configuration files
7+
COPY .env .env
8+
COPY config/legacy/parameters.yaml.dist config/legacy/parameters.yaml
9+
10+
# Add the config files for Apache2
11+
RUN rm -rf /etc/apache2/sites-enabled/*
12+
COPY ./docker/conf/selfservice-apache2.conf /etc/apache2/sites-enabled/selfservice.conf
13+
EXPOSE 80
14+
15+
# Set the default workdir
16+
WORKDIR /var/www/html
17+
18+
CMD ["apache2-foreground"]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Virtualhost *:80>
2+
ServerName selfservice
3+
ServerAdmin [email protected]
4+
5+
DocumentRoot /var/www/html/public
6+
7+
SetEnv APP_ENV prod
8+
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
9+
10+
<Directory "/var/www/html/public">
11+
Require all granted
12+
13+
Options -MultiViews
14+
RewriteEngine On
15+
RewriteCond %{REQUEST_FILENAME} !-f
16+
RewriteRule ^(.*)$ index.php [QSA,L]
17+
</Directory>
18+
<Location />
19+
Require all granted
20+
</Location>
21+
22+
Header always set X-Content-Type-Options "nosniff"
23+
24+
# Set the php application handler so mod_php interpets the files
25+
<FilesMatch \.php$>
26+
SetHandler application/x-httpd-php
27+
</FilesMatch>
28+
29+
ExpiresActive on
30+
ExpiresByType font/* "access plus 1 year"
31+
ExpiresByType image/* "access plus 6 months"
32+
ExpiresByType text/css "access plus 1 year"
33+
ExpiresByType text/js "access plus 1 year"
34+
</VirtualHost>

0 commit comments

Comments
 (0)