Skip to content

Instantly share code, notes, and snippets.

@nextrevision
Last active April 2, 2021 00:58
Show Gist options
  • Save nextrevision/12b78ef5ea72ff0e71ab to your computer and use it in GitHub Desktop.
Save nextrevision/12b78ef5ea72ff0e71ab to your computer and use it in GitHub Desktop.
Sempl Workflow with Docker Container
FROM ubuntu:trusty
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y apache2 wget
RUN wget -O /usr/local/bin/sempl \
https://raw.githubusercontent.com/nextrevision/sempl/0.2.1/sempl
RUN chmod 755 /usr/local/bin/sempl
ADD index.html.tmpl /app/index.html.tmpl
ADD startup.sh /app/startup.sh
EXPOSE 80
CMD ["/bin/bash", "/app/startup.sh"]
<html>
<head>
<title>App X - $(hostname -f)</title>
</head>
<body>
<div class="content">
<h1>${HEADING:-Hello!}</h1>
<p>Welcome to region ${REGION:-us-west-1}</p>
</div>
### begin
# if [ ${DEBUG:-0} -eq 1 ]; then
<div class="debugging">
IP addresses:
<ul>
# for i in $(ip a | awk '/inet /{print $2}' | cut -d'/' -f1); do
<li>$i</li>
# done
</ul>
</div>
# fi
### end
</body>
</html>
/usr/local/bin/sempl /app/index.html.tmpl /var/www/html/index.html
/usr/sbin/apache2ctl -D FOREGROUND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment