From 9ee36727efa5b56d8fd78d347d614122994a7919 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Mon, 30 Dec 2019 15:59:58 +0100 Subject: [PATCH] Dockerized app --- Dockerfile | 9 +++++++++ README.md => app/README.md | 0 config.py => app/config.py | 2 +- requirements.txt => app/requirements.txt | 0 server.py => app/server.py | 0 slider.py => app/slider.py | 0 {static => app/static}/clear.gif | Bin {static => app/static}/loading.gif | Bin {templates => app/templates}/random.html | 0 docker-compose.yml | 13 +++++++++++++ 10 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Dockerfile rename README.md => app/README.md (100%) rename config.py => app/config.py (84%) rename requirements.txt => app/requirements.txt (100%) rename server.py => app/server.py (100%) rename slider.py => app/slider.py (100%) rename {static => app/static}/clear.gif (100%) rename {static => app/static}/loading.gif (100%) rename {templates => app/templates}/random.html (100%) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e43f0e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3 +ADD app /app +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --requirement /app/requirements.txt +WORKDIR /app + +EXPOSE 5000/TCP + +CMD [ "python3", "server.py" ] diff --git a/README.md b/app/README.md similarity index 100% rename from README.md rename to app/README.md diff --git a/config.py b/app/config.py similarity index 84% rename from config.py rename to app/config.py index 5d7a0c9..bc07eb6 100644 --- a/config.py +++ b/app/config.py @@ -1,4 +1,4 @@ -imgdir = "." +imgdir = "/images" recursive = True refresh = 5 cachedir = "auto" diff --git a/requirements.txt b/app/requirements.txt similarity index 100% rename from requirements.txt rename to app/requirements.txt diff --git a/server.py b/app/server.py similarity index 100% rename from server.py rename to app/server.py diff --git a/slider.py b/app/slider.py similarity index 100% rename from slider.py rename to app/slider.py diff --git a/static/clear.gif b/app/static/clear.gif similarity index 100% rename from static/clear.gif rename to app/static/clear.gif diff --git a/static/loading.gif b/app/static/loading.gif similarity index 100% rename from static/loading.gif rename to app/static/loading.gif diff --git a/templates/random.html b/app/templates/random.html similarity index 100% rename from templates/random.html rename to app/templates/random.html diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4922ce9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: "2" + +services: + webslider: + container_name: webslider + build: + context: . + ports: + - 5005:5000 + volumes: + - ./images:/images + restart: always +