add docker file

This commit is contained in:
mrjvs
2022-05-07 22:43:12 +02:00
parent 402f6e3e2e
commit d03122a4a6
3 changed files with 32 additions and 0 deletions

5
.dockerignore Normal file
View File

@@ -0,0 +1,5 @@
.git
config.json
logs
certs
cdn

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM node:14-alpine
RUN apk add --no-cache python3 make gcc g++
WORKDIR /app
COPY "docker/entrypoint.sh" .
COPY package*.json .
RUN npm install
COPY . .
VOLUME [ "/app/config.json" ]
CMD ["sh", "entrypoint.sh"]

12
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
files='config.json certs/nex/datastore/secret.key certs/nex/secret.key certs/nex/public.pem'
for file in $files; do
if [ ! -f $file ]; then
echo "$PWD/$file file does not exist. Please mount and try again."
exit 1
fi
done
exec node src/server.js