2020-02-25 23:14:50 +01:00
|
|
|
FROM node:12.16.1 as base
|
2018-06-07 22:09:51 +02:00
|
|
|
ENV APP_HOME=/usr/src/app \
|
|
|
|
TERM=xterm
|
|
|
|
RUN mkdir -p $APP_HOME
|
|
|
|
WORKDIR $APP_HOME
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
FROM base as development
|
|
|
|
ENV NODE_ENV development
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
RUN npm install
|
|
|
|
RUN npm rebuild node-sass
|
2018-09-26 22:14:06 +02:00
|
|
|
COPY .babelrc index.js nodemon.json ./
|
|
|
|
COPY ./webpack ./webpack
|
2018-06-07 22:09:51 +02:00
|
|
|
COPY client ./client
|
|
|
|
COPY server ./server
|
2020-07-13 21:33:34 +02:00
|
|
|
COPY translations/locales ./translations/locales
|
2018-06-07 22:09:51 +02:00
|
|
|
CMD ["npm", "start"]
|
|
|
|
|
|
|
|
FROM development as build
|
|
|
|
ENV NODE_ENV production
|
2020-12-16 08:49:12 +01:00
|
|
|
RUN npm run build:server
|
|
|
|
RUN npm run build:client
|
2018-06-07 22:09:51 +02:00
|
|
|
|
|
|
|
FROM base as production
|
|
|
|
ENV NODE_ENV=production
|
2018-08-10 23:11:04 +02:00
|
|
|
COPY package.json package-lock.json index.js ./
|
2018-06-07 22:09:51 +02:00
|
|
|
RUN npm install --production
|
|
|
|
RUN npm rebuild node-sass
|
2018-08-28 20:47:05 +02:00
|
|
|
COPY --from=build $APP_HOME/dist ./dist
|
2018-08-10 23:11:04 +02:00
|
|
|
CMD ["npm", "run", "start:prod"]
|