From 6823c84e5f9fc2cc515a9618e66f3416f10cb7b3 Mon Sep 17 00:00:00 2001
From: Maurice <mauricegolverdingen@gmail.com>
Date: Thu, 3 Nov 2022 14:50:07 +0100
Subject: [PATCH] Added services, updated build script

---
 Dockerfile          |  1 +
 build.sh            |  8 +++++---
 nginx-conf.txt      |  6 ++++++
 pastabble-openrc.sh | 11 +++++++++++
 4 files changed, 23 insertions(+), 3 deletions(-)
 create mode 100644 nginx-conf.txt
 create mode 100644 pastabble-openrc.sh

diff --git a/Dockerfile b/Dockerfile
index be8cd7c..383a04a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,6 @@
 FROM alpine:edge
 WORKDIR /app
+VOLUME [ "/data" ]
 
 COPY ./target/x86_64-unknown-linux-musl/release/ /app
 COPY ./about.html /app/about.html
diff --git a/build.sh b/build.sh
index d5fade4..ee38509 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
-RUNNER="podman"
-
 cargo build --target x86_64-unknown-linux-musl --release
-$RUNNER build -t pastabble:latest .
\ No newline at end of file
+podman build -t pastabble:latest .
+podman save --format oci-archive -o pastabble.tar pastabble
+
+# load with podman load -i pastabble.tar
+# run with podman run -p 8080:8080 --name pastabble-c -v pastabble-v:/data -it pastabble
\ No newline at end of file
diff --git a/nginx-conf.txt b/nginx-conf.txt
new file mode 100644
index 0000000..67acb30
--- /dev/null
+++ b/nginx-conf.txt
@@ -0,0 +1,6 @@
+server {
+    server_name paste.plabble.org;
+    location / {
+        proxy_pass  http://127.0.0.1:8080;
+    }
+}
\ No newline at end of file
diff --git a/pastabble-openrc.sh b/pastabble-openrc.sh
new file mode 100644
index 0000000..68b0ab0
--- /dev/null
+++ b/pastabble-openrc.sh
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# Copyright 2022 Plabble
+
+start() {
+    podman rm pastabble-c || true
+    podman run --name pastabble-c -p 8080:8080 -v pastabble-v:/data -dt pastabble
+}
+
+stop() {
+    podman stop pastabble-c
+}
\ No newline at end of file