Files
firma/Dockerfile
2025-12-25 10:38:12 +00:00

41 lines
728 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install --force
COPY . .
RUN npm run build
FROM nginx:alpine
# Default html tozalaymiz
RUN rm -rf /usr/share/nginx/html/*
# ❗ MUHIM: .next emas, out papka
COPY --from=builder /app/out /usr/share/nginx/html
# Default nginx configni ochiramiz
RUN rm /etc/nginx/conf.d/default.conf
# nginx.conf ni bevosita Dockerfile ichida yozamiz
RUN printf '%s\n' \
'server {' \
' listen 80;' \
' server_name _;' \
'' \
' root /usr/share/nginx/html;' \
' index index.html;' \
'' \
' location / {' \
' try_files $uri $uri/ /index.html;' \
' }' \
'}' \
> /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]