# Use the official image as a parent image.
FROM node:18.16
# FROM node:current-slim

# Set the working directory.
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Copy the file from your host to your current location.
# COPY package.json .
## UPDATE: 28 JULY 2021 PREVIOUS (LINE BELOW FOR LOCAL DOCKER?):
# COPY package.json /usr/src/app
COPY backend /usr/src/app
# COPY /public /usr/src/app

# Run the command inside your image filesystem.
RUN npm install

#set the environment
ENV NODE_ENV staging

# Inform Docker that the container is listening on the specified port at runtime.
EXPOSE 8000

# Run the specified command within the container.
CMD [ "npm", "run", "prod" ]

# Copy the rest of your app's source code from your host to your image filesystem.
# COPY . .
## UPDATE: 28 JULY 2021 PREVIOUS (LINE BELOW FOR LOCAL DOCKER?):
# COPY . /usr/src/app
# COPY /bmim /usr/src/app

# FROM node:latest
# RUN mkdir -p /usr/src/app
# WORKDIR /usr/src/app
# COPY package.json /usr/src/app/
# RUN npm install
# COPY . /usr/src/app
# EXPOSE  3001
# CMD [ “npm”, “start” ]