kidshift-be/Dockerfile

26 lines
504 B
Docker
Raw Normal View History

2024-06-23 08:20:18 +00:00
FROM node:18-alpine
2024-06-23 07:01:46 +00:00
2024-06-23 08:20:18 +00:00
# Set working directory
2024-06-23 07:01:46 +00:00
WORKDIR /usr/src/kidshift
2024-06-23 08:20:18 +00:00
# Copy package files and install dependencies
2024-06-23 07:01:46 +00:00
COPY package*.json ./
RUN npm install
2024-06-23 08:20:18 +00:00
# Copy Prisma files and generate Prisma client
2024-06-23 08:14:19 +00:00
COPY prisma ./prisma/
2024-06-23 07:01:46 +00:00
RUN npx prisma generate
2024-06-23 08:20:18 +00:00
# Copy the rest of the application code and build the project
COPY . .
2024-06-23 07:01:46 +00:00
RUN npm run build
2024-06-23 08:20:18 +00:00
# Set environment variables if necessary
ENV NODE_ENV=production
2024-06-23 07:01:46 +00:00
2024-06-23 08:20:18 +00:00
# Expose the application port
2024-06-23 07:01:46 +00:00
EXPOSE 3000
2024-06-23 08:20:18 +00:00
# Command to run the application
CMD ["npm", "start"]