When using Docker+Astro+Bun my env variable from .env can be read without docker using import.meta.env.PUBLIC_API_URL
but when using docker import.meta.env does not have PUBLIC_API_URL and process.env is undefined
this is my dockerfile
FROM oven/bun:canary-debian as base
WORKDIR /app
FROM base AS install
USER root
COPY ./package.json ./bun.lockb ./astro.config.mjs ./postcss.config.js ./tailwind.config.js ./tsconfig.json ./
COPY ./src ./src
COPY ./public ./public
# Install dependencies
RUN bun install
FROM base AS release
USER root
COPY --from=install /app/ .
RUN bunx --bun astro build
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
# CMD bunx astro dev
CMD bun run ./dist/server/entry.mjs
this is how I try to obtain my variable in a <script> tag
const API_URL = import.meta.env["PUBLIC_API_URL"] || process.env["PUBLIC_API_URL"];
console.log('API_URL', API_URL);