Created
February 7, 2021 03:04
-
-
Save digitalronin/424134ef9a68a11ddcccaed3878b7c68 to your computer and use it in GitHub Desktop.
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 flask import Flask | |
app = Flask(__name__) | |
@app.route('/bar') | |
def hello(): | |
return '{"msg":"Hello from the bar microservice"}' | |
if __name__ == "__main__": | |
app.run(debug=True, host='0.0.0.0') |
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/bash | |
TAG=0.1 | |
set -euo pipefail | |
docker login | |
for svc in foo bar; do | |
docker build -f Dockerfile.$svc -t $svc . | |
docker tag $svc digitalronin/$svc-microservice:0.1 | |
docker push digitalronin/$svc-microservice:0.1 | |
done |
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 python:3-alpine | |
WORKDIR /app | |
RUN echo "Flask==1.1.1" > requirements.txt | |
RUN pip install -r requirements.txt | |
COPY bar.py . | |
EXPOSE 5000 | |
CMD ["python", "bar.py"] |
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 python:3-alpine | |
WORKDIR /app | |
RUN echo "Flask==1.1.1" > requirements.txt | |
RUN pip install -r requirements.txt | |
COPY foo.py . | |
EXPOSE 5000 | |
CMD ["python", "foo.py"] |
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 flask import Flask | |
app = Flask(__name__) | |
@app.route('/foo') | |
def hello(): | |
return '{"msg":"Hello from the foo microservice"}' | |
if __name__ == "__main__": | |
app.run(debug=True, host='0.0.0.0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment