# Use Node.js LTS (Long Term Support) version | |
FROM node:20-slim | |
# 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 | |
COPY package*.json ./ | |
# Install dependencies | |
RUN npm install | |
# Bundle app source | |
COPY . . | |
# Create a directory for uploaded files if needed | |
#RUN mkdir -p public | |
# Your app binds to port 3000 so you'll use the EXPOSE instruction to have it mapped by the docker daemon | |
EXPOSE 7860 | |
# Define environment variable | |
ENV PORT=7860 | |
# Command to run the application | |
CMD [ "node", "index.js" ] |