forked from LondheShubham153/Wanderlust-Mega-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (22 loc) · 835 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# ------------------- Stage 1: Build Stage ------------------------------
FROM node:21 AS frontend-builder
# Set the working directory to /app
WORKDIR /app
# Copy the package.json and package-lock.json for dependency installation
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# ------------------- Stage 2: Final Stage ------------------------------
FROM node:21-slim
# Set the working directory to /app
WORKDIR /app
# Copy built assets and dependencies from frontend-builder stage
COPY --from=frontend-builder /app .
# Copy the .env.sample file to .env.local
COPY .env.docker .env.local
# Expose port 5173 for the Node.js application
EXPOSE 5173
# Define the default command to run the application in development mode
CMD ["npm", "run", "dev", "--", "--host"]