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"]
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 )
--- /dev/null
+<!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>
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