diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..a60b7a9 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,22 @@ +kind: pipeline +type: docker +name: default + +steps: +- name: webpack + image: node + commands: + - npm install + - npm run publish + +- name: publish-container + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + dockerfile: Dockerfile + purge: true + repo: arminfriedl/netclock + tags: latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..54d9198 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:alpine + +RUN apk update && apk add redis su-exec \ + && pip3 install pipenv + +COPY . /app +WORKDIR /app + +ENV FLASK_APP=netclock.py +ENV FLASK_ENV=production + +RUN pipenv install + +EXPOSE 5000 +ENTRYPOINT ["./entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..773566e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +redis-server & + +pipenv run flask run