diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2dcb968 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:bionic + +RUN apt-get update && \ + apt-get install -y wget software-properties-common && \ + echo "deb https://deb.nodesource.com/node_10.x bionic main" | tee /etc/apt/sources.list.d/nodesource.list && \ + wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ + apt-get update && \ + apt-get install -y nodejs + +ADD . /tmp/code/ + +RUN cd /tmp/code && \ + npm install && \ + ./node_modules/.bin/grunt + +FROM ubuntu:bionic + +ADD . /tmp/code/ + +COPY --from=0 /tmp/code/styles/dist/style.css /tmp/code/styles/dist/style.css + +RUN apt-get update && \ + apt-get install -y python3-pip sudo + +RUN pip3 install -U pip && \ + cd /tmp/code && \ + pip install -r requirements.txt && \ + python3 setup.py install && \ + useradd --uid 1000 app + +VOLUME /data/ + +ADD start /start + +ENTRYPOINT ["/start"] diff --git a/requirements.txt b/requirements.txt index 7a8137e..a8561ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ more-itertools==4.3.0 persistent==4.4.2 portend==2.3 pytz==2018.5 +PyYAML==3.13 six==1.11.0 tempora==1.13 transaction==2.2.1 diff --git a/start b/start new file mode 100755 index 0000000..6a9db2b --- /dev/null +++ b/start @@ -0,0 +1,5 @@ +#!/bin/sh + +sudo chown -R app:app /data + +exec sudo -Hu app nodepupperd --database /data/pup.db $@