]> Untitled Git - web-gallery.git/commitdiff
Initial hello
authorClifton Palmer <clifton.james.palmer@protonmail.com>
Sat, 28 Oct 2023 11:55:12 +0000 (06:55 -0500)
committerClifton Palmer <clifton.james.palmer@protonmail.com>
Sat, 28 Oct 2023 11:55:12 +0000 (06:55 -0500)
.gitignore [new file with mode: 0644]
Dockerfile [new file with mode: 0644]
app/app.py [new file with mode: 0644]
app/templates/hello.html [new file with mode: 0644]
docker-compose.yml [new file with mode: 0644]
readme.md [new file with mode: 0644]
requirements.txt [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..bee8a64
--- /dev/null
@@ -0,0 +1 @@
+__pycache__
diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..0ef69aa
--- /dev/null
@@ -0,0 +1,17 @@
+FROM python:3.7-alpine
+
+ENV FLASK_APP=app.py
+ENV FLASK_RUN_HOST=0.0.0.0
+ENV FLASK_PORT=5000
+
+EXPOSE 5000
+
+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
+
+CMD ["flask", "run"]
diff --git a/app/app.py b/app/app.py
new file mode 100644 (file)
index 0000000..c4d55bd
--- /dev/null
@@ -0,0 +1,7 @@
+from flask import Flask, render_template
+
+app = Flask(__name__)
+
+@app.route('/')
+def customer():
+    return render_template('hello.html')
diff --git a/app/templates/hello.html b/app/templates/hello.html
new file mode 100644 (file)
index 0000000..ce4191f
--- /dev/null
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Hello, world!</p>
+</body>
+</html>
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644 (file)
index 0000000..bc5f097
--- /dev/null
@@ -0,0 +1,18 @@
+version: '3'
+services:
+    db:
+        image: postgres:13.4-alpine
+        environment:
+            POSTGRES_USER: admin
+            POSTGRES_PASSWORD: adminpw
+        ports:
+        - 5432:5432
+    web:
+        build: .
+        image: cjpalmer/gallery:0.1.0
+        volumes:
+        - ./app:/app
+        environment:
+            FLASK_DEBUG: 1
+        ports:
+        - 80:5000
diff --git a/readme.md b/readme.md
new file mode 100644 (file)
index 0000000..3e2613a
--- /dev/null
+++ b/readme.md
@@ -0,0 +1 @@
+A web gallery for my comics
diff --git a/requirements.txt b/requirements.txt
new file mode 100644 (file)
index 0000000..ec23c0a
--- /dev/null
@@ -0,0 +1,2 @@
+psycopg2
+flask