mirror of
https://github.com/Wolvan/poll.horse.git
synced 2024-11-28 07:07:59 +01:00
22 lines
665 B
Docker
22 lines
665 B
Docker
|
FROM node:lts-alpine
|
||
|
WORKDIR /usr/src/app
|
||
|
|
||
|
# Add Tini
|
||
|
RUN apk add --update tini
|
||
|
|
||
|
# Install and build application
|
||
|
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
|
||
|
RUN npm set-script prepublish ""
|
||
|
RUN npm install --silent && npm cache clean --silent --force
|
||
|
COPY . .
|
||
|
RUN npm test
|
||
|
RUN npm run build
|
||
|
RUN rm -rf src utils .eslintignore .eslintrc.json .mocharc.json test tsconfig.json
|
||
|
RUN npm prune --production --silent
|
||
|
RUN chown -R node /usr/src/app
|
||
|
RUN mv node_modules ../
|
||
|
ENV PORT=6969
|
||
|
RUN mkdir -p /data && chown -R node /data
|
||
|
USER node
|
||
|
ENTRYPOINT ["/sbin/tini", "--", "node", "dist/main", "--port", "env:PORT", "--data-directory", "/data"]
|