summaryrefslogtreecommitdiff
path: root/images/paste
diff options
context:
space:
mode:
Diffstat (limited to 'images/paste')
-rw-r--r--images/paste/Dockerfile24
-rw-r--r--images/paste/pb/config.yaml7
-rw-r--r--images/paste/service/mongo/run3
-rw-r--r--images/paste/service/uwsgi/run4
-rw-r--r--images/paste/uwsgi/pb.ini7
5 files changed, 45 insertions, 0 deletions
diff --git a/images/paste/Dockerfile b/images/paste/Dockerfile
new file mode 100644
index 0000000..9eedd40
--- /dev/null
+++ b/images/paste/Dockerfile
@@ -0,0 +1,24 @@
+# Currently uses edge instead of 3.5 because it needs
+# the mongodb package only available on edge
+
+FROM alpine:edge AS builder
+
+RUN apk add --no-cache git python3 py3-pip nodejs nodejs-npm graphicsmagick
+RUN git clone --single-branch --depth=1 --recursive https://github.com/ptpb/pb /app/pb
+
+RUN cd /app/pb \
+ && npm install -g grunt-cli \
+ && npm install && (cd node_modules/pbs; npm install) \
+ && grunt
+
+RUN cd /app/pb \
+ && pip3 install --user -r requirements.txt
+
+FROM server_runit-edge
+
+RUN apk add --no-cache python3 uwsgi-python3 mongodb
+COPY --from=builder /app/pb /app/pb
+COPY --from=builder /root/.local /root/.local
+
+ADD pb/config.yaml /root/.config/pb/config.yaml
+ADD uwsgi/pb.ini /app/pb.ini
diff --git a/images/paste/pb/config.yaml b/images/paste/pb/config.yaml
new file mode 100644
index 0000000..ebf8837
--- /dev/null
+++ b/images/paste/pb/config.yaml
@@ -0,0 +1,7 @@
+DEBUG: false
+
+MONGO:
+ host: localhost
+ port: 27017
+
+MONGO_DATABASE: pb
diff --git a/images/paste/service/mongo/run b/images/paste/service/mongo/run
new file mode 100644
index 0000000..996df8b
--- /dev/null
+++ b/images/paste/service/mongo/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /data/db
+mongod
diff --git a/images/paste/service/uwsgi/run b/images/paste/service/uwsgi/run
new file mode 100644
index 0000000..2900244
--- /dev/null
+++ b/images/paste/service/uwsgi/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+export PYTHONPATH=/app/pb:$PYTHONPATH
+/app/pb/runonce.py
+exec uwsgi --ini /app/pb.ini
diff --git a/images/paste/uwsgi/pb.ini b/images/paste/uwsgi/pb.ini
new file mode 100644
index 0000000..b035e38
--- /dev/null
+++ b/images/paste/uwsgi/pb.ini
@@ -0,0 +1,7 @@
+[uwsgi]
+socket = [::]:10002
+mountpoint = /app/pb
+module = pb.run:app
+plugins = python3
+processes = 4
+threads = 4