-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (29 loc) · 1020 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
# Initiate a container to build the application in.
FROM node:14
# ENV NODE_ENV=build
WORKDIR /usr/src/app
# Copy the package.json into the container. .........
# COPY package.json ./
# COPY package-lock.json ./
# RUN apk --no-cache add yarn
# Install the dependencies required to build the application.
# RUN yarn install
# Copy the application source into the container.
COPY . .
RUN rm -rf node_modules && \
npm install && \
npm run build
# RUN npm install
# Build the application.
# RUN npm run build
# Uninstall the dependencies not required to run the built application.
# Initiate a new container to run the application in.
# FROM node:16-alpine
# ENV NODE_ENV=production
# Copy everything required to run the built application into the new container.
# COPY --from=builder /usr/src/app/package*.json ./
# COPY --from=builder /usr/src/app/node_modules/ ./node_modules/
# COPY --from=builder /usr/src/app/dist/ ./dist/
# Run the application.
CMD ["node", "dist/main"]
# CMD ["sleep" ,"1000"]