dockerize application

This commit is contained in:
mrjvs 2022-05-08 16:24:05 +02:00
parent b78d4c858b
commit 6b810749ad
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