Dockerize server

This commit is contained in:
Dennis Reimann 2021-02-04 12:33:37 +01:00
parent 146597ce6a
commit 422791094f
No known key found for this signature in database
GPG key ID: 5009E1797F03F8D0
2 changed files with 25 additions and 0 deletions

3
server/.dockerignore Normal file
View file

@ -0,0 +1,3 @@
.env
data.json
node_modules

22
server/Dockerfile Normal file
View file

@ -0,0 +1,22 @@
FROM node:14-buster-slim AS builder
WORKDIR /build
RUN apt-get update
RUN apt-get install -y git python3 build-essential
COPY . .
RUN npm ci --production
FROM node:14-buster-slim
WORKDIR /build
RUN apt-get update
RUN apt-get install -y firefox-esr pngcrush jo jq torsocks curl cron
COPY --from=builder /build .
ADD .env.sample .env
RUN echo "PATH=/bin:/usr/bin:/usr/local/bin\n* * * * * root /bin/bash /build/cron.sh > /build/cron.log\n#" | crontab -
RUN service cron start
EXPOSE 3030
CMD ["npm", "start"]
# docker build -t kindle-display .
# docker run --name kindle-display -p 3030:3030 -it kindle-display
# docker exec -it kindle-display bash