-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdockerfile
More file actions
25 lines (21 loc) · 794 Bytes
/
dockerfile
File metadata and controls
25 lines (21 loc) · 794 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
## Reading Env file using Docker-compose docker-compose --env-file ./config/.env.dev up
FROM node:current-slim As development
WORKDIR /usr/src/app
COPY package*.json ./
COPY . .
RUN npm i -g @nestjs/cli
RUN apt-get update && apt-get install -y build-essential && apt-get install -y python && npm install
RUN npm run build
RUN ls -a
FROM node:current-slim as production
ENV FIREBASE_APPLICATION_CREDENTIALS=/usr/src/app/google-credentials.json
WORKDIR /usr/src/app
RUN ls -a
RUN pwd
COPY --from=development /usr/src/app/package*.json ./
COPY --from=development /usr/src/app/node_modules ./node_modules
COPY --from=development /usr/src/app/dist ./dist
COPY --from=development /usr/src/app/google-credentials.json ./google-credentials.json
RUN ls -a
COPY .env ./
CMD ["node", "dist/main"]