-
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
07be635
commit 07df90c
Showing
1 changed file
with
12 additions
and
5 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 |
---|---|---|
@@ -1,18 +1,25 @@ | ||
# Use base image from nodejs alpine | ||
FROM node:20.12-alpine | ||
FROM node:20.12-alpine as build | ||
|
||
# Set workdir in docker container | ||
WORKDIR /app | ||
|
||
# Copy all file inside docker container | ||
# COPY package*.json . | ||
COPY . . | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# RUN npm run build | ||
RUN npm run build | ||
|
||
# runs app | ||
CMD npm run dev | ||
# Use a lightweight web server to serve the app | ||
FROM nginx:alpine | ||
|
||
# Copy the build output to the Nginx web server directory | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
# Expose the port on which the app will run | ||
EXPOSE 80 | ||
|
||
# Start Nginx server | ||
CMD ["nginx", "-g", "daemon off;"] |