2023-04-02 13:43:22 +00:00
|
|
|
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 ./
|
|
|
|
|
|
|
|
RUN npm install
|
2023-04-03 16:52:41 +00:00
|
|
|
|
|
|
|
RUN npm install -g typescript
|
|
|
|
|
2023-04-02 13:43:22 +00:00
|
|
|
# If you are building your code for production
|
|
|
|
# RUN npm ci --omit=dev
|
|
|
|
|
|
|
|
# Bundle app source
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
EXPOSE ${PORT}
|
2023-04-03 16:52:41 +00:00
|
|
|
|
|
|
|
# run npm build to create the dist folder
|
|
|
|
|
|
|
|
RUN tsc
|
|
|
|
# run npm start to start the server
|
|
|
|
CMD [ "npm", "start" ]
|
|
|
|
|