Refactor Docker build and automatically push images (#41)

Refactor Docker build / Add GitHub workflow for creating and publishing Docker image
This commit is contained in:
Jochen Schalanda
2022-01-24 16:41:23 +01:00
committed by GitHub
parent 0de6d3df04
commit 2764b2b776
5 changed files with 71 additions and 38 deletions

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
# syntax=docker/dockerfile:1.3
FROM node:16-alpine AS builder
COPY --chown=1000:1000 . /fredy
WORKDIR /fredy
USER 1000
RUN yarn install
RUN yarn run prod
FROM node:16-alpine
COPY --from=builder --chown=1000:1000 /fredy /fredy
RUN mkdir /db /conf && \
chown 1000:1000 /db /conf && \
ln -s /db /fredy/db && ln -s /conf /fredy/conf
EXPOSE 9998
USER 1000
VOLUME [ "/conf", "/db" ]
WORKDIR /fredy
CMD node index.js --no-daemon