From 9ba0d63211c65719c92c7050896eb5419721c317 Mon Sep 17 00:00:00 2001 From: Joaquin Date: Fri, 26 May 2023 17:35:54 +0300 Subject: [PATCH] [docker] Add Dockerfile --- .dockerignore | 1 + Dockerfile | 16 ++++++++++++++++ README.md | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 README.md diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..98e6e2e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM alpine:latest +EXPOSE 80 +ADD . /app +RUN apk add nodejs npm sed + +RUN cat /app/app.js \ + | sed 's/8881/80/g' > /app/app.js + +RUN cd /app \ + && npm i + +RUN apk del sed + +WORKDIR /app +ENTRYPOINT ["/usr/bin/node"] +CMD ["/app"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..bbf6e15 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Vianuvote + +A simple portable electronic voting system I made for my school's student council (actively used as of may 2023) + +This repo is mostly for internal deployment and was not made as a general solution (tho inspiration can be taken). If you're not from within the council this repo is probably useless to you + +## Installation + +`git clone https://github.com/KoNickss/csevote` + +`cd csevote` + +`npm i` + +`node .` + +Login details are securely stored as sha256sums in repo/credentials + + +## Docker + +Build docker image + +`docker build -t vianuvote .` + +Run without db volume + +`docker run -d -p 811:80 vianuvote` + +Run with db volume + +`docker run -d -p 811:80 -v foo-volume:/app/repo vianuvote` +