2020-04-19 17:18:38 +02:00
|
|
|
FROM node:11 as base
|
|
|
|
|
|
|
|
# Create app directory
|
|
|
|
RUN mkdir -p /opt/app
|
|
|
|
WORKDIR /opt/app
|
|
|
|
|
|
|
|
# Install app dependencies
|
|
|
|
COPY ./package.json package-lock.json ./
|
|
|
|
RUN npm ci
|
|
|
|
|
|
|
|
# Bundle frontend
|
|
|
|
COPY src ./src
|
|
|
|
COPY assets ./assets
|
|
|
|
COPY config ./config
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
|
|
#####################
|
|
|
|
# Final image
|
|
|
|
#####################
|
|
|
|
|
|
|
|
FROM node:11-alpine
|
|
|
|
ENV NODE_ENV=prod
|
2018-02-08 17:45:07 +01:00
|
|
|
|
|
|
|
MAINTAINER cracker0dks
|
|
|
|
|
|
|
|
# Create app directory
|
|
|
|
RUN mkdir -p /opt/app
|
|
|
|
WORKDIR /opt/app
|
|
|
|
|
2020-04-19 17:18:38 +02:00
|
|
|
COPY ./package.json ./package-lock.json ./
|
|
|
|
RUN npm ci --only=prod
|
2018-02-08 17:45:07 +01:00
|
|
|
|
2020-04-19 17:18:38 +02:00
|
|
|
COPY scripts ./scripts
|
|
|
|
COPY --from=base /opt/app/public ./public
|
2018-02-08 17:45:07 +01:00
|
|
|
|
2019-02-04 19:53:23 +01:00
|
|
|
EXPOSE 8080
|
2020-04-19 17:18:38 +02:00
|
|
|
ENTRYPOINT [ "npm", "run", "start:prod-no-build" ]
|