Command-fix/Dockerfile

26 lines
542 B
Docker
Raw Normal View History

FROM node:16-alpine AS build
2017-09-24 21:44:49 +02:00
# Create app directory
WORKDIR /usr/src/app
2020-05-02 07:35:33 +02:00
# Install app dependencies and add source files
COPY package.json env.json yarn.lock tsconfig.json bundle.sh *.js ./
COPY ./src ./src
RUN yarn install --frozen-lockfile && sh -e ./bundle.sh
2017-09-24 21:44:49 +02:00
2020-05-02 07:35:33 +02:00
# Second stage
FROM node:16-alpine
2020-05-02 07:35:33 +02:00
WORKDIR /usr/src/app
# Copy artifacts
COPY --from=build /usr/src/app/dist/ ./
2017-09-24 21:44:49 +02:00
2017-10-01 22:46:05 +02:00
RUN addgroup -S app -g 50000 && \
adduser -S -g app -u 50000 app && \
mkdir /data && chown app:app /data/
2017-10-01 22:46:05 +02:00
USER app
2020-05-02 07:35:33 +02:00
ENTRYPOINT [ "node", "server.js" ]