You are viewing the local version.
+diff --git a/application/Dockerfile b/application/Dockerfile index 3c35911..f4a63f7 100644 --- a/application/Dockerfile +++ b/application/Dockerfile @@ -1,21 +1,5 @@ -# Use an official Python runtime as a parent image -FROM python:3.8-slim +# Use the Nginx unprivileged as a parent image +FROM docker.io/nginxinc/nginx-unprivileged:1.25-alpine -# Set the working directory in the container -WORKDIR /app - -# Copy the current directory contents into the container at /app -COPY src /app - -# Install any needed packages specified in requirements.txt -RUN pip install --trusted-host pypi.python.org Flask - -# Make port 80 available to the world outside this container -EXPOSE 5000 - -# Define environment variable -ENV NAME World - -# Run app.py when the container launches -CMD ["python", "app.py"] - \ No newline at end of file +# Copy the static content into the container at /usr/share/nginx/html/ +COPY src/local/index.html /usr/share/nginx/html/ diff --git a/application/README.md b/application/README.md index 9f46e7a..8378fc7 100644 --- a/application/README.md +++ b/application/README.md @@ -9,13 +9,13 @@ podman build -t localhost/kiosk-app:latest . Run the container image. ```sh -podman run -it --rm --name kiosk-app -p 5000:5000 localhost/kiosk-app:latest +podman run -it --rm --name kiosk-app -p 8080:8080 localhost/kiosk-app:latest ``` Test it. ```sh -curl -I http://localhost:5000/ +curl -I http://localhost:8080/ ``` Login to the registry. diff --git a/application/src/app.py b/application/src/app.py deleted file mode 100644 index f700f9c..0000000 --- a/application/src/app.py +++ /dev/null @@ -1,20 +0,0 @@ -import platform -from flask import Flask, render_template - -app = Flask(__name__, template_folder="/app/templates") - - -@app.route('/') -def system_info(): - system_info = { - 'System': platform.system(), - 'Node Name': platform.node(), - 'Release': platform.release(), - 'Version': platform.version(), - 'Machine': platform.machine(), - 'Processor': platform.processor() - } - return render_template('index.html', system_info=system_info) - -if __name__ == '__main__': - app.run(host="0.0.0.0", debug=True) \ No newline at end of file diff --git a/application/src/local/index.html b/application/src/local/index.html new file mode 100644 index 0000000..f5b6f67 --- /dev/null +++ b/application/src/local/index.html @@ -0,0 +1,36 @@ + + +
+ + + + +You are viewing the local version.
+You are viewing the online version.
+| Attribute | -Value | -
|---|---|
| {{ key }} | -{{ value }} | -