-
Notifications
You must be signed in to change notification settings - Fork 1
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
a5bced0
commit 39bd2c2
Showing
1 changed file
with
9 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 |
---|---|---|
@@ -1,19 +1,28 @@ | ||
# Bosqich 1: Loyiha bog'liqliklarini o'rnatish va ishlab chiqish | ||
FROM node:16 AS build | ||
|
||
WORKDIR /app | ||
|
||
# package.json va package-lock.json fayllarini ko'chirish | ||
COPY package*.json ./ | ||
|
||
# Bog'liqliklarni o'rnatish | ||
RUN npm install | ||
|
||
# Loyiha fayllarini ko'chirish va ishlab chiqish | ||
COPY . . | ||
|
||
# Loyihani ishlab chiqish | ||
RUN npm run build | ||
|
||
# Bosqich 2: Ishlab chiqilgan loyihani nginx serverga joylashtirish | ||
FROM nginx:alpine | ||
|
||
# Nginx konfiguratsiyasini sozlash (agar kerak bo'lsa) | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Ishlab chiqilgan fayllarni nginx statik fayllar joylashgan papkaga ko'chirish | ||
COPY --from=build /app/build /usr/share/nginx/html | ||
|
||
# Nginx serverni ishga tushirish | ||
CMD ["nginx", "-g", "daemon off;"] |