diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9b62922 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM node:22-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm i ---force + +COPY . . +RUN npm run build + +FROM nginx:alpine + +RUN rm -rf /usr/share/nginx/html/* + +COPY --from=builder /app/dist /usr/share/nginx/html + +RUN rm /etc/nginx/conf.d/default.conf +RUN echo 'server { \ + listen 80; \ + server_name _; \ + root /usr/share/nginx/html; \ + index index.html; \ + location / { \ + try_files $uri /index.html; \ + } \ + error_page 404 /index.html; \ +}' > /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..04f90f2 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +services: + frontend: + build: . + container_name: meridyn-admin + ports: + - "3002:80" + volumes: + - .:/app + - /app/node_modules + environment: + - CHOKIDAR_USEPOLLING=true + - HOST=0.0.0.0 \ No newline at end of file diff --git a/src/features/districts/ui/AddDistrict.tsx b/src/features/districts/ui/AddDistrict.tsx index b2d487a..e8f6d19 100644 --- a/src/features/districts/ui/AddDistrict.tsx +++ b/src/features/districts/ui/AddDistrict.tsx @@ -64,10 +64,15 @@ export default function AddDistrict({ initialValues, setDialogOpen }: Props) { const messageText = errMessage.message; const errMessageName = err.response?.data as { data: { name: [string] } }; const messageTextName = errMessageName.data.name[0]; - toast.error(messageTextName || messageText || "Xatolik yuz berdi", { - richColors: true, - position: "top-center", - }); + toast.error( + (messageTextName && "Bu tuman oldin qo'shilgan") || + messageText || + "Xatolik yuz berdi", + { + richColors: true, + position: "top-center", + }, + ); }, });