-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile-small
44 lines (33 loc) · 1.17 KB
/
Dockerfile-small
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
43
44
# Install dependencies only when needed
FROM node:16-alpine
# ENV NODE_ENV=production
ENV CI=true
#Next we create a directory to hold the application code inside the image
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY ["package.json", "yarn.lock*", "pnpm-lock.yaml*", "./"]
# RUN yarn install --production=true
RUN yarn install
#To bundle your app's source code inside the Docker image, use the COPY instruction:
# COPY . .
FROM node:16-alpine
WORKDIR /app
COPY --from=0 /app .
COPY . .
RUN yarn build
ENV MONGO_URL=mongodb+srv://admin:[email protected]/sortlog-dev
ENV auth_encryption_salt=some-salt
ENV PORT=4000
CMD ["yarn", "start"]
# Install dependencies only when needed
# FROM node:16-alpine
# #Next we create a directory to hold the application code inside the image
# WORKDIR /app
# # Install dependencies based on the preferred package manager
# COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
# RUN yarn install
# #To bundle your app's source code inside the Docker image, use the COPY instruction:
# COPY . .
# # should I have yarn build at this stagge ?
# RUN ls -a
# CMD ["node", "dist/server.js"]