Merge pull request #4 from PretendoNetwork/docker

dockerize application
This commit is contained in:
Jonathan Barrow 2022-05-09 07:58:20 -04:00 committed by GitHub
commit 4b8445eabe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
.git
config.json
logs
node_modules

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM node:18-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'
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