Created
June 17, 2020 05:24
-
-
Save velotiotech/0fa7d63d44a3073746abff1d07602e63 to your computer and use it in GitHub Desktop.
Velotio - HashiCorp Consul Part 2 - Dockerfile for MongoDB Docker Container
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 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