Skip to content

Commit

Permalink
Adding the Dockerfiles and config to build the container images
Browse files Browse the repository at this point in the history
  • Loading branch information
danakim committed Jun 19, 2023
1 parent 0d986a4 commit bfac87e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ghcr.io/openconext/openconext-basecontainers/php72-apache2-node14-composer2:latest

RUN rm -rf /etc/apache2/sites-enabled/*
COPY ./docker/conf/selfservice-apache2.conf /etc/apache2/sites-enabled/selfservice.conf
EXPOSE 80

# Set the default workdir
WORKDIR /var/www/html

CMD ["apache2-foreground"]
18 changes: 18 additions & 0 deletions docker/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ghcr.io/openconext/openconext-basecontainers/php72-apache2:latest AS php-build
COPY *.tar.bz2 /tmp/
RUN tar -xvjf /tmp/*.tar.bz2 -C /var/www/html/ && \
rm -rf /tmp/*.tar.bz2

# Add the application configuration files
COPY .env .env
COPY config/legacy/parameters.yaml.dist config/legacy/parameters.yaml

# Add the config files for Apache2
RUN rm -rf /etc/apache2/sites-enabled/*
COPY ./docker/conf/selfservice-apache2.conf /etc/apache2/sites-enabled/selfservice.conf
EXPOSE 80

# Set the default workdir
WORKDIR /var/www/html

CMD ["apache2-foreground"]
34 changes: 34 additions & 0 deletions docker/conf/selfservice-apache2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Virtualhost *:80>
ServerName selfservice
ServerAdmin [email protected]

DocumentRoot /var/www/html/public

SetEnv APP_ENV prod
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

<Directory "/var/www/html/public">
Require all granted

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
<Location />
Require all granted
</Location>

Header always set X-Content-Type-Options "nosniff"

# Set the php application handler so mod_php interpets the files
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

ExpiresActive on
ExpiresByType font/* "access plus 1 year"
ExpiresByType image/* "access plus 6 months"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/js "access plus 1 year"
</VirtualHost>

0 comments on commit bfac87e

Please sign in to comment.