mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2024-05-18 12:50:41 -04:00
add docker files and remove static config.json
This commit is contained in:
parent
cc8f890f08
commit
0606435ce0
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
node_modules
|
||||
.git
|
||||
config.json
|
||||
certs
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
.DS_Store
|
||||
node_modules
|
||||
certs
|
||||
|
|
15
Dockerfile
Normal file
15
Dockerfile
Normal 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", "/app/certs" ]
|
||||
|
||||
CMD ["sh", "entrypoint.sh"]
|
12
docker/entrypoint.sh
Normal file
12
docker/entrypoint.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
files='config.json certs/access/private.pem certs/access/aes.key'
|
||||
|
||||
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
|
Loading…
Reference in a new issue