chore: optimized docs image

This commit is contained in:
ITQ
2025-05-08 12:50:28 +03:00
parent f7a6affe87
commit d6009b0f41
2 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ http {
}
location /docs {
proxy_pass http://docs:3000;
proxy_pass http://docs:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
+8 -6
View File
@@ -1,5 +1,5 @@
# Stage 1: Base image
FROM node:lts AS base
FROM node:lts-alpine AS base
ENV FORCE_COLOR=0
@@ -14,13 +14,15 @@ WORKDIR /opt/docusaurus
COPY . /opt/docusaurus/
RUN npm ci
RUN npm ci --omit=dev
RUN npm run build
# Stage 3: Serve with docusaurus serve
FROM prod AS serve
# Stage 3: Serve with nginx
FROM nginx:stable-alpine AS serve
EXPOSE 3000
COPY --from=builder /opt/docusaurus/build /usr/share/nginx/html
CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"]
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]