Skip to content

Commit

Permalink
chore(docker): introduce dockerrun.bash
Browse files Browse the repository at this point in the history
  • Loading branch information
frickjack authored and Avantol13 committed Sep 12, 2018
1 parent dd012f5 commit 8623a6a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ RUN ln -s /fence/wsgi.py /var/www/fence/wsgi.py \
EXPOSE 80
WORKDIR /var/www/fence/

CMD rm -f /var/run/apache2/apache2.pid && /usr/sbin/apache2ctl -D FOREGROUND
CMD bash ./dockerrun.bash
28 changes: 28 additions & 0 deletions dockerrun.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

#
# Update certificate authority index -
# environment may have mounted more authorities
#
update-ca-certificates
#
# Enable debug flag based on GEN3_DEBUG environment
#
if [ -f ./wsgi.py && "$GEN3_DEBUG" == "True" ]; then
echo -e "\napplication.debug=True\n" >> ./wsgi.py
fi
#
# Kubernetes may mount jwt-keys as a tar ball
#
if [ -f /fence/jwt-keys.tar ]; then
(
cd /fence
tar xvf jwt-keys.tar
if [ -d jwt-keys ]; then
mkdir -p keys
mv jwt-keys/* keys/
fi
)
fi
rm -rf /var/run/apache2/apache2.pid
/usr/sbin/apache2ctl -D FOREGROUND

0 comments on commit 8623a6a

Please sign in to comment.