24 lines
393 B
Docker
24 lines
393 B
Docker
# Use official Node.js image as base
|
|
FROM node:18
|
|
|
|
# Create app directory
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy package.json and package-lock.json (if available)
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
# Build
|
|
RUN npm run build
|
|
|
|
# Copy app source code
|
|
COPY . .
|
|
|
|
# Expose the port your app runs on (optional, depends on your app)
|
|
EXPOSE 3000
|
|
|
|
# Start the app
|
|
CMD ["npm", "start"]
|