# Use the official image as a parent image.
FROM node:22.4.1
# 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 backend /usr/src/app/backend
COPY frontend /usr/src/app/frontend
COPY package.json /usr/src/app/package.json
COPY package-lock.json /usr/src/app/package-lock.json

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

#set the environment
ENV NODE_ENV staging
ENV NEXT_PUBLIC_HOSTIP=62.171.144.4

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

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