diff --git a/Dockerfile.docs b/Dockerfile.docs index 4b409d9..a6366ab 100644 --- a/Dockerfile.docs +++ b/Dockerfile.docs @@ -8,5 +8,7 @@ COPY docs/ . RUN npm run build FROM nginx:alpine +RUN rm /etc/nginx/conf.d/default.conf +COPY docs/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /app/.vitepress/dist /usr/share/nginx/html EXPOSE 80 diff --git a/docs/nginx.conf b/docs/nginx.conf new file mode 100644 index 0000000..27c304f --- /dev/null +++ b/docs/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ $uri.html /index.html; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +}