-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
42 lines (34 loc) · 945 Bytes
/
Dockerfile
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
32
33
34
35
36
37
38
39
40
41
42
FROM node:16 as base
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
FROM base as production_build
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json package-lock.json* ./
RUN npm ci --production
ARG ENV_ENVIRONMENT='development'
ENV ENV_ENVIRONMENT=$ENV_ENVIRONMENT
ARG ENV_SECRET='mwmBqNcTWiKxDHygMiKhwyffaKQCVoRQ'
ENV ENV_SECRET=$ENV_SECRET
COPY . ./
RUN npm run prod-build
FROM node:16-alpine as production
ARG REVISION='local'
ENV REVISION=$REVISION
ENV PORT 3122
EXPOSE 3122
COPY --from=production_build /usr/src/app /voluntarily
WORKDIR /voluntarily
CMD ["npm", "start" ]
FROM base as development
ENV NODE_ENV=development
ENV MONGOMS_DOWNLOAD_MIRROR="http://downloads.mongodb.org"
ENV MONGOMS_VERSION="v4.0-latest"
ENV ENV_ENVIRONMENT='development'
ENV ENV_SECRET='mwmBqNcTWiKxDHygMiKhwyffaKQCVoRQ'
ENV PORT 3122
EXPOSE 3122
COPY package.json package-lock.json* ./
RUN npm install
COPY . ./
CMD ["npm", "run", "dev"]