p5.js-web-editor/Dockerfile

32 lines
757 B
Docker
Raw Permalink Normal View History

FROM node:12.16.1 as base
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
COPY .babelrc index.js nodemon.json ./
COPY ./webpack ./webpack
COPY client ./client
COPY server ./server
COPY translations/locales ./translations/locales
CMD ["npm", "start"]
FROM development as build
ENV NODE_ENV production
2020-12-16 07:49:12 +00:00
RUN npm run build:server
RUN npm run build:client
2020-12-16 09:58:18 +00:00
FROM build as production
ENV NODE_ENV=production
COPY package.json package-lock.json index.js ./
RUN npm install --production
RUN npm rebuild node-sass
2020-12-16 09:58:18 +00:00
# COPY --from=build $APP_HOME/dist ./dist
CMD ["npm", "run", "start:prod"]