Last active
December 5, 2015 04:52
-
-
Save taxilian/7ef7d2a05f78e5c5b1a4 to your computer and use it in GitHub Desktop.
Docker container for fb-irc-logviewer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from phusion/passenger-ruby19 | |
ENV HOME=/root TZ="America/Boise" | |
entrypoint ["/sbin/my_init", "--"] | |
RUN apt-get update && apt-get install -y openjdk-7-jre \ | |
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ | |
&& rm -f /etc/service/nginx/down \ | |
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*a \ | |
&& mkdir -p /etc/service/elasticsearch | |
COPY elastic*.tar.gz /opt/ | |
COPY nginx*.conf /etc/nginx/sites-enabled/ | |
WORKDIR /home/app | |
RUN rm -f /etc/nginx/sites-enabled/default \ | |
&& cd /opt && tar vxzf elastic*.tar.gz && rm *.tar.gz && mv elasticsearch* elasticsearch/ && cd /home/app \ | |
&& git clone --depth=1 https://github.com/firebreath/fb-irc-logviewer.git \ | |
&& chown -R app: fb-irc-logviewer \ | |
&& cd fb-irc-logviewer \ | |
&& bundle install \ | |
&& cd .. | |
COPY elasticsearch.runit /etc/service/elasticsearch/run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# `setuser` is part of baseimage-docker. `setuser mecached xxx...` runs the given command | |
# (`xxx...`) as the user `memcache`. If you omit this, the command will be run as root. | |
exec /sbin/setuser app /opt/elasticsearch/bin/elasticsearch -f >> /var/log/elasticsearch.log 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name logs.firebreath.org; | |
root /home/app/fb-irc-logviewer/public; | |
# The following deploys your Ruby/Python/Node.js/Meteor app on Passenger. | |
passenger_enabled on; | |
passenger_user app; | |
passenger_ruby /usr/bin/ruby; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
IMG=fb-irc-logs | |
CNAME=fblogs | |
#docker pull $IMG | |
docker stop $CNAME | |
docker rm $CNAME | |
docker run \ | |
-d \ | |
-v /home/core/irclog-dbconfig.yml:/home/app/fb-irc-logviewer/config/database.yml \ | |
-v /data/magnetic/znc:/root/.znc \ | |
-v /data/magnetic/irclogs/data:/opt/elasticsearch/data \ | |
--link postgres:postgres \ | |
-e VIRTUAL_HOST=logs.firebreath.org \ | |
--name $CNAME \ | |
--restart=always \ | |
$IMG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment