Skip to content

Instantly share code, notes, and snippets.

@digitalronin
Created February 7, 2021 03:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save digitalronin/424134ef9a68a11ddcccaed3878b7c68 to your computer and use it in GitHub Desktop.
Save digitalronin/424134ef9a68a11ddcccaed3878b7c68 to your computer and use it in GitHub Desktop.
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')
#!/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
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"]
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"]
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