# FROM node:14

# # Create app directory
# RUN mkdir -p /usr/src/app && chown -R node:node /usr/src/app
# WORKDIR /usr/src/app
# COPY --chown=node:node . .
# USER node

# RUN npm install

# # Building app
# # RUN npm run build
# EXPOSE 3000

# # Running the app
# CMD "npm" "run" "dev"

FROM node:14

# Create app directory
RUN mkdir -p /usr/src/app && chown -R node:node /usr/src/app
WORKDIR /usr/src/app


COPY package.json /usr/src/app

# Installing dependencies
RUN npm install

# # Copying source files
COPY . /usr/src/app

# Build App
RUN npm run build

# Building app
EXPOSE 3000

# Running the app
CMD "npm" "start"