Skip to content

Commit

Permalink
Start of development for production dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Feb 24, 2020
1 parent 7358f02 commit 1fc4b5d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ db.sqlite3
setup.cfg
/cover/
.coverage
debug.log
debug.log
/docker/configs/certs/
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ services:
- DJANGO_ENABLE_DEBUG
- DJANGO_EMAIL_USER
- DJANGO_EMAIL_PASSWORD
- DJANGO_USE_SHIBBOLETH
- DJANGO_SETTINGS_MODULE=puzzlehunt_server.settings.env_settings
- DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@db/puzzlehunt_db
depends_on:
Expand Down
23 changes: 13 additions & 10 deletions docker/apacheShibDockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
FROM debian:10

RUN apt update
RUN apt install -y apache2 gnupg curl ntp
RUN apt-get update
RUN apt-get install -y apache2 gnupg curl ntp
RUN cd /tmp
RUN curl --fail --remote-name https://pkg.switch.ch/switchaai/debian/dists/buster/main/binary-all/misc/switchaai-apt-source_1.0.0_all.deb
RUN apt install ./switchaai-apt-source_1.0.0_all.deb
RUN apt-get install -y ./switchaai-apt-source_1.0.0_all.deb
RUN rm ./switchaai-apt-source_1.0.0_all.deb
RUN apt update
RUN apt install --install-recommends shibboleth
RUN apt install libapache2-mod-xsendfile libapache2-mod-shib
RUN apt-get update
RUN apt-get install -y --install-recommends shibboleth
RUN apt-get install -y libapache2-mod-xsendfile libapache2-mod-shib
RUN a2enmod proxy proxy_http proxy_html xsendfile shib

RUN rm /etc/apache2/sites-enabled/*

COPY configs/puzzlehunt_apache.conf /etc/apache2/sites-available/puzzlehunt.conf
COPY configs/certs/sp-cert.pem /etc/shibboleth/sp-cert.pem
COPY configs/certs/sp-key.pem /etc/shibboleth/sp-key.pem
COPY --chown=_shibd:_shibd configs/certs/sp-cert.pem /etc/shibboleth/sp-cert.pem
COPY --chown=_shibd:_shibd configs/certs/sp-key.pem /etc/shibboleth/sp-key.pem
RUN chmod 644 /etc/shibboleth/sp-*
COPY configs/shibboleth2.xml /etc/shibboleth/shibboleth2.xml

RUN a2ensite puzzlehunt

RUN mkdir -p /static
RUN mkdir -p /media

ENTRYPOINT ["/usr/sbin/apache2ctl"]
CMD ["-D", "FOREGROUND"]
COPY apacheShibForeground /usr/local/bin/
RUN chmod +x /usr/local/bin/apacheShibForeground

CMD ["/usr/local/bin/apacheShibForeground"]
7 changes: 7 additions & 0 deletions docker/apacheShibForeground
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

rm -f /etc/apache2/run/httpd.pid /var/lock/subsys/shibd

service shibd start

exec /usr/sbin/apache2ctl -D FOREGROUND
3 changes: 3 additions & 0 deletions docker/shib_override.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
version: '3'

services:
web:
build:
dockerfile: apacheShibDockerfile

0 comments on commit 1fc4b5d

Please sign in to comment.