Last active
April 4, 2018 10:42
-
-
Save DanielTimLee/eacc70cdc0c3ccb613a6f0d78d93770e to your computer and use it in GitHub Desktop.
Docker Final
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
REPO=ccuu | |
TAG=v1 | |
docker build -t ${REPO}:${TAG} . | |
# docker run -p 9000:9000 -p 28017:28017 -p 27017:27017 -it ${REPO}:${TAG} | |
docker run -p 9000:9000 -p 28017:28017 -p 27017:27017 -d ${REPO}:${TAG} | |
# docker run -p 9000:9000 -p 28017:28017 -p 27017:27017 -d ${REPO}:${TAG} mongod |
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 nvidia/cuda:latest | |
RUN \ | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 && \ | |
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb.list && \ | |
apt-get update && \ | |
apt-get install -y mongodb-org && \ | |
apt-get install -y python3 python3-pip | |
RUN pip3 install flask | |
RUN mkdir -p /data/db | |
EXPOSE 9000 | |
EXPOSE 27017 | |
EXPOSE 28017 | |
WORKDIR / | |
COPY ./ . | |
ENTRYPOINT ["/entrypoint.sh"] |
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
#!/bin/bash | |
echo "from flask import Flask, redirect, url_for | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return 'hi' | |
if __name__ == '__main__': | |
app.run(port=9000,host='0.0.0.0') | |
""" > server.py | |
mongod --fork --logpath /dev/null | |
python3 server.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment