commit c6539f8232d4b7ba2576bde1a3d7c3afc240d47f Author: Eljakim Herrewijnen Date: Thu Mar 7 23:05:00 2024 +0100 Initial diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8a30429 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Use an official Python runtime as a parent image +FROM python:3.8-slim-buster + +# Set the working directory in the container to /app +WORKDIR /app + +# Add the current directory contents into the container at /app +ADD . /app + +# Install any needed packages specified in requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +# Make port 80 available to the world outside this container +EXPOSE 80 + +# Run app.py when the container launches +CMD ["python", "app.py"] \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..05aaa2b --- /dev/null +++ b/Readme.md @@ -0,0 +1,23 @@ +# Bible Stories + +This is a simple Flask application that can be run in a Docker container. + +## Prerequisites + +You need to have Docker installed on your machine. You can download Docker [here](https://www.docker.com/products/docker-desktop). + +## Building the Docker Image + +To build the Docker image, navigate to the project root directory (where the Dockerfile is located) in your terminal and run the following command: + +```bash +docker build -t your-image-name . +``` + +## Deploy + +```bash +docker run -p 4000:80 your-image-name +``` + +This will start the Docker container and map port 80 in the container to port 4000 on your host machine. \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..9155627 --- /dev/null +++ b/app.py @@ -0,0 +1,35 @@ +from flask import Flask, render_template +import random + +app = Flask(__name__) + +stories = [ + { + 'image': 'story1.png', + 'title': 'Nuttig is mijn naam, onzeker mijn bestaan.', + 'answer': 'Onesimus in de brief van Paulus aan Filemon. Onesimus betekent nuttig en was een weg gelopen slaaf die, met een brief van Paulus, terug ging naar zijn meester Filemon.' + }, + { + 'image': 'story2.jpeg', + 'title': 'Mijn komst is geprofeteerd maar in Israel wordt ik niet vereerd', + 'answer': 'Kores. Kores wordt in Jesaja 45:1 genoemd als de gezalfde van God. Hij was het die de Joden toestemming gaf om terug te keren naar Jeruzalem.' + }, + { + 'image': 'story3.jpeg', + 'title': 'Samen zijn we overdonderend.', + 'answer': 'Jacobes en Johannes. De gebroederes van de donder genoemd in Markus 3:17' + }, + { + 'image': 'story4.png', + 'title': 'Ooit was ik groot en blij. Nu is het onrustig met mij in de wei', + 'answer': 'Nebukadnezar. In Daniƫl 4:30 wordt Nebukadnezar de koning van Babel genoemd. Hij was de koning die een tijd als een beest leefde.' + } +] + +@app.route('/') +def index(): + story = random.choice(stories) + return render_template('index.html', story=story) + +if __name__ == '__main__': + app.run(host='0.0.0.0') \ No newline at end of file diff --git a/static/story1.png b/static/story1.png new file mode 100644 index 0000000..c1f3ba4 Binary files /dev/null and b/static/story1.png differ diff --git a/static/story2.jpeg b/static/story2.jpeg new file mode 100644 index 0000000..aefb7c5 Binary files /dev/null and b/static/story2.jpeg differ diff --git a/static/story3.jpeg b/static/story3.jpeg new file mode 100644 index 0000000..3207e2c Binary files /dev/null and b/static/story3.jpeg differ diff --git a/static/story4.png b/static/story4.png new file mode 100644 index 0000000..c1f3ba4 Binary files /dev/null and b/static/story4.png differ diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..efbd4c5 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,38 @@ + + + + {{ story.title }} + + + + + +
+
+
+ {{ story.title }} +
+
{{ story.title }}
+ + +
+
+ {{ story.answer }} +
+
+
+
+
+
+ + + + + + \ No newline at end of file