-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (28 loc) · 723 Bytes
/
Dockerfile
File metadata and controls
31 lines (28 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:18.20.8 AS base
ENV APP_HOME=/usr/src/app \
TERM=xterm
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
EXPOSE 8000
EXPOSE 8002
FROM base AS development
ENV NODE_ENV development
COPY package.json package-lock.json ./
RUN npm install
COPY .babelrc index.js nodemon.json ./
COPY ./webpack ./webpack
COPY client ./client
COPY server ./server
COPY common ./common
COPY translations/locales ./translations/locales
COPY public ./public
CMD ["npm", "start"]
FROM development AS build
ENV NODE_ENV production
RUN npm run build
FROM base AS production
ENV NODE_ENV=production
COPY package.json package-lock.json index.js ./
RUN npm install --production
COPY --from=build $APP_HOME/dist ./dist
CMD ["npm", "run", "start:prod"]