From 2fa0db0e2bc74dea04e6b1f7e392f9339cbd4273 Mon Sep 17 00:00:00 2001 From: sneak Date: Tue, 6 Aug 2019 18:50:20 +0000 Subject: [PATCH] runs in docker now --- Dockerfile | 27 +++++++++++++++++++++++++++ Makefile | 3 +++ bin/{strpc => strpcd} | 0 sources.list | 4 ++++ strpcd.run | 5 +++++ 5 files changed, 39 insertions(+) create mode 100644 Dockerfile rename bin/{strpc => strpcd} (100%) create mode 100644 sources.list create mode 100644 strpcd.run diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..347aa36 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM phusion/baseimage:0.11 + +ENV LOG_TO_SYSLOG 1 + +ENV APPDIR /var/app + +VOLUME /strpc + +ENV STRPC_BASE /var/lib/strpc + +ADD ./sources.list /etc/apt/sources.list + +RUN apt update && apt install -y python3-pip + +RUN pip3 install pipenv + +RUN mkdir -p /var/lib/strpc + +ADD . /var/app + +WORKDIR /var/app + +RUN pipenv install + +RUN mkdir -p /etc/service/strpcd && \ + mv /var/app/strpcd.run /etc/service/strpcd/run && \ + chmod +x /etc/service/strpcd/run diff --git a/Makefile b/Makefile index 52921d9..849f15e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ default: devserver +build: + docker build -t sneak/strpc . + devserver: /bin/bash bin/devserver diff --git a/bin/strpc b/bin/strpcd similarity index 100% rename from bin/strpc rename to bin/strpcd diff --git a/sources.list b/sources.list new file mode 100644 index 0000000..30e191e --- /dev/null +++ b/sources.list @@ -0,0 +1,4 @@ +deb mirror://mirrors.ubuntu.com/mirrors.txt bionic main universe multiverse restricted +deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-updates main universe multiverse restricted +deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-security main universe multiverse restricted +deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-backports main universe multiverse restricted diff --git a/strpcd.run b/strpcd.run new file mode 100644 index 0000000..0d97500 --- /dev/null +++ b/strpcd.run @@ -0,0 +1,5 @@ +#!/bin/bash + +export PYTHONPATH="$APPDIR" +cd "$APPDIR" +exec pipenv run bin/strpcd