Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
FROM node:alpine
FROM node:alpine as base

WORKDIR /usr/src/app

COPY package*.json .
COPY dist dist
COPY . .

RUN npm install --ignore-scripts
RUN npm ci

EXPOSE 9000
RUN npm run build

FROM node:alpine

WORKDIR /usr/src/app

ENV PORT=""
ENV TARGET=""
ENV EXPIRY=""

COPY --from=base --chown=nobody:nogroup /usr/src/app/dist dist
COPY --from=base --chown=nobody:nogroup /usr/src/app/node_modules node_modules
USER nobody
EXPOSE 9000

CMD sh -c "node dist/index.js --port $PORT --target $TARGET --expiry $EXPIRY"