From bd7021fa85f8d60693d8e1458084ba8167852d77 Mon Sep 17 00:00:00 2001 From: jeanGaston Date: Mon, 29 Jan 2024 16:24:09 +0100 Subject: [PATCH] Init Creation of dokerfiles for scraper and webgui. --- DataScraper/DOCKERFILE_DataScraper | 14 ++++++++++++++ DataScraper/Helloworld.py | 1 + Install.sh | 0 WebGui/DOCKERFILE_webgui | 14 ++++++++++++++ WebGui/Helloworld.py | 10 ++++++++++ WebGui/requirements.txt | 1 + docker-compose.yml | 12 ++++++++++++ 7 files changed, 52 insertions(+) create mode 100644 DataScraper/DOCKERFILE_DataScraper create mode 100644 DataScraper/Helloworld.py create mode 100644 Install.sh create mode 100644 WebGui/DOCKERFILE_webgui create mode 100644 WebGui/Helloworld.py create mode 100644 WebGui/requirements.txt create mode 100644 docker-compose.yml diff --git a/DataScraper/DOCKERFILE_DataScraper b/DataScraper/DOCKERFILE_DataScraper new file mode 100644 index 0000000..60d29dd --- /dev/null +++ b/DataScraper/DOCKERFILE_DataScraper @@ -0,0 +1,14 @@ +# Use the official Python image as a base image +FROM python:3.8-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the script1.py and any other necessary files +COPY Helloworld.py /app/ + +# Install any dependencies specific to script1.py +RUN pip install --no-cache-dir -r requirements.txt + +# Set the entry point +CMD ["python", "Helloworld.py"] \ No newline at end of file diff --git a/DataScraper/Helloworld.py b/DataScraper/Helloworld.py new file mode 100644 index 0000000..f6552ac --- /dev/null +++ b/DataScraper/Helloworld.py @@ -0,0 +1 @@ +print('HelloWorld') diff --git a/Install.sh b/Install.sh new file mode 100644 index 0000000..e69de29 diff --git a/WebGui/DOCKERFILE_webgui b/WebGui/DOCKERFILE_webgui new file mode 100644 index 0000000..c37c73c --- /dev/null +++ b/WebGui/DOCKERFILE_webgui @@ -0,0 +1,14 @@ +# Use the official Python image as a base image +FROM python:3.8-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the script1.py and any other necessary files +COPY Helloworld.py /app/ + +# Install any dependencies specific to script1.py +RUN pip install --no-cache-dir -r requirements.txt + +# Set the entry point +CMD ["python", "Helloworld.py"] diff --git a/WebGui/Helloworld.py b/WebGui/Helloworld.py new file mode 100644 index 0000000..57c26a7 --- /dev/null +++ b/WebGui/Helloworld.py @@ -0,0 +1,10 @@ +from flask import Flask + +app = Flask(__name__) + +@app.route('/') +def hello_world(): + return 'Hello, World!' + +if __name__ == '__main__': + app.run(debug=True) diff --git a/WebGui/requirements.txt b/WebGui/requirements.txt new file mode 100644 index 0000000..7d47fc5 --- /dev/null +++ b/WebGui/requirements.txt @@ -0,0 +1 @@ +Flask==2.1.2 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1a6a05b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + DataScraper: + build: + context: ./DataScraper + dockerfile: Dockerfile_DataScraper + + WebGui: + build: + context: ./WebGui + dockerfile: Dockerfile_webgui