-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a5d43f
commit d25970b
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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"] |