]> Untitled Git - web-gallery.git/commitdiff
Dynamic gallery discovery
authorClifton Palmer <clifton.james.palmer@protonmail.com>
Sat, 28 Oct 2023 12:23:28 +0000 (07:23 -0500)
committerClifton Palmer <clifton.james.palmer@protonmail.com>
Sat, 28 Oct 2023 12:23:28 +0000 (07:23 -0500)
.gitignore
Dockerfile
app/app.py
app/templates/gallery.html [new file with mode: 0644]
docker-compose.yml

index bee8a64b79a99590d5303307144172cfe824fbf7..bec372b02f1c16c7e6e750b11b3abf66b6c60db2 100644 (file)
@@ -1 +1,2 @@
+*.swp
 __pycache__
index 0ef69aaa3475a89c04ea8e4be14f40bba0d88ef8..c3e0f8365c2ea40884dac3561df1557ddf60cada 100644 (file)
@@ -10,8 +10,9 @@ RUN apk update && \
     apk add --no-cache gcc musl-dev linux-headers libpq-dev python3-dev
 
 WORKDIR /app
-COPY ./app /app
 COPY ./requirements.txt /app
 RUN pip install -r requirements.txt
 
+COPY ./app /app
+
 CMD ["flask", "run"]
index c4d55bd4ef7aa0a74d484dd3045644c9c0e6e5fb..86cbf799ee072e87873f4f0a630654b447ca5e59 100644 (file)
@@ -3,5 +3,6 @@ from flask import Flask, render_template
 app = Flask(__name__)
 
 @app.route('/')
-def customer():
-    return render_template('hello.html')
+def render_gallery():
+    items = ['LittleWilly', 'foo', 'bar']
+    return render_template( 'gallery.html', gallery_items=items )
diff --git a/app/templates/gallery.html b/app/templates/gallery.html
new file mode 100644 (file)
index 0000000..7f893b1
--- /dev/null
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <title>Gallery</title>
+</head>
+<body>
+    <h1>Gallery</h1>
+
+    <ul id="navigation">
+    {% for item in gallery_items %}
+        <li><a href="{{ item }}">{{ item }}</a></li>
+    {% endfor %}
+    </ul>
+</body>
+</html>
index bc5f097b97ab1e309bdd5e20b7e60cebcbb14183..8a8677278b1baaa60516adfe26b21bc8ccf077b6 100644 (file)
@@ -11,8 +11,16 @@ services:
         build: .
         image: cjpalmer/gallery:0.1.0
         volumes:
+        - gallery_data:/app/gallery
         - ./app:/app
         environment:
             FLASK_DEBUG: 1
         ports:
         - 80:5000
+volumes:
+    gallery_data:
+        driver: local
+        driver_opts:
+            o: bind
+            type: none
+            device: /mnt/gallery_data