diff --git a/quote_disp/Dockerfile b/quote_disp/Dockerfile new file mode 100644 index 0000000..43c4a6a --- /dev/null +++ b/quote_disp/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.8-slim-buster +COPY . /app +WORKDIR /app +RUN pip install -r requirements.txt +ENTRYPOINT [ "python" ] +CMD [ "app.py" ] diff --git a/quote_disp/app.py b/quote_disp/app.py index 18b3844..ce69477 100644 --- a/quote_disp/app.py +++ b/quote_disp/app.py @@ -18,7 +18,7 @@ def home(): @app.route("/get_quote") def quote(): - quote = requests.get("http://gen:5000/quote").text + quote = requests.get("http://quote-gen-container:5000/quote").text print("quote - ", quote) return render_template("quote.html", quote=quote) diff --git a/quote_disp/docker-compose.yml b/quote_disp/docker-compose.yml new file mode 100644 index 0000000..5e103ba --- /dev/null +++ b/quote_disp/docker-compose.yml @@ -0,0 +1,16 @@ +version: "3.7" + +services: + web1: + build: ./quote_gen + container_name: quote-gen-container + ports: + - "5000:5000" + + web2: + build: ./quote_disp + container_name: code-disp-container + ports: + - "5001:5001" + depends_on: + - web1 \ No newline at end of file diff --git a/quote_gen/Dockerfile b/quote_gen/Dockerfile new file mode 100644 index 0000000..43c4a6a --- /dev/null +++ b/quote_gen/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.8-slim-buster +COPY . /app +WORKDIR /app +RUN pip install -r requirements.txt +ENTRYPOINT [ "python" ] +CMD [ "app.py" ]