Created
April 1, 2019 10:55
-
-
Save pranavcode/24592c73e1303b68b88825dd764b5728 to your computer and use it in GitHub Desktop.
Velotio - HashiCorp Consul Part 2 - Dockerfile for MongoDB Docker Container
This file contains hidden or 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 ubuntu:18.04 | |
RUN apt-get update && \ | |
apt-get install -y \ | |
bash curl nano net-tools zip unzip \ | |
jq dnsutils iputils-ping | |
# Install MongoDB | |
RUN apt-get install -y mongodb | |
RUN mkdir -p /data/db | |
VOLUME data:/data/db | |
# Setup Consul and Goreman | |
ADD https://releases.hashicorp.com/consul/1.4.4/consul_1.4.4_linux_amd64.zip /tmp/consul.zip | |
RUN cd /bin && unzip /tmp/consul.zip && chmod +x /bin/consul && rm /tmp/consul.zip | |
ADD https://github.com/mattn/goreman/releases/download/v0.0.10/goreman_linux_amd64.zip /tmp/goreman.zip | |
RUN cd /bin && unzip /tmp/goreman.zip && chmod +x /bin/goreman && rm /tmp/goreman.zip | |
RUN mkdir -p /etc/consul.d/check_scripts | |
ADD ./config/mongod /etc | |
RUN mkdir -p /etc/checks | |
ADD ./config/checks /opt/checks | |
ADD checks_toggler.sh /opt | |
ADD mongo.sh /opt | |
ADD consul.sh /opt | |
ADD Procfile /root/Procfile | |
EXPOSE 27017 | |
# Launch both MongoDB server and Consul | |
ENTRYPOINT [ "goreman" ] | |
CMD [ "-f", "/root/Procfile", "start" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment