I get "Blocked request" when deploying astro website on kubernetes #408
|
I get this error when trying to reach the astro app deployed on big-mama.io I tried doing as it says and adding the host to allowes hosts in vite.config.js but the error stayed but the same problem here the docker file I am using # Use the official lightweight Node.js image with a version that supports pnpm.
FROM node:18-slim
# Set the working directory inside the container
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm serve
# Copy the package.json and pnpm-lock.yaml files first to leverage Docker cache
COPY package.json pnpm-lock.yaml ./
# Install dependencies using pnpm
RUN pnpm install --frozen-lockfile
# Copy the rest of your app's source code
COPY . .
# Build the Astro application
RUN pnpm run build
EXPOSE 4321
# Serve the build directory on container startup
CMD ["pnpm", "run", "preview", "--host"]my please help me slove this |
Answered by
ArnaudBarre
Jan 23, 2025
Replies: 2 comments 1 reply
You should read https://vite.dev/guide/static-deploy.html#deploying-a-static-site or https://docs.astro.build/en/guides/deploy/ If you site is purely static, I advice using Netlify which doesn't require anything a part from linking the github repo. |
1 reply
Answer selected by
1hachem
|
Yes |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should read https://vite.dev/guide/static-deploy.html#deploying-a-static-site or https://docs.astro.build/en/guides/deploy/
If you site is purely static, I advice using Netlify which doesn't require anything a part from linking the github repo.