forked from pi-apps/demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (23 loc) · 790 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
FROM node:16
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package.json ./
COPY yarn.lock ./
# When building for production, use the lockfile as-is:
RUN yarn install --frozen-lockfile
# RUN npm ci --only=production
# Bundle app source
# TODO make this only copy the necessary files instead of copying the whole directory
COPY ./src ./src
COPY ./tsconfig.json ./tsconfig.json
RUN yarn build
RUN yarn global add pm2
COPY ./docker/processes.config.js ./processes.config.js
RUN mkdir -p log && touch log/.keep
EXPOSE 8080
CMD [ "pm2-runtime", "./processes.config.js" ]
# CMD [ "pm2-runtime", "build/index.js" ]
# CMD [ "node", "build/index.js" ]