FROM docker.io/oven/bun:alpine AS build ENV NODE_ENV=production WORKDIR /usr/src/app RUN chown -R bun:bun /usr/src/app USER bun COPY tsconfig.app.json ./ COPY tsconfig.node.json ./ COPY tsconfig.json ./ COPY package.json ./ COPY bun.lock ./ COPY vite.config.ts ./ COPY svelte.config.js ./ RUN bun install --ignore-scripts --frozen-lockfile COPY public ./public COPY src ./src COPY index.html ./ COPY nginx ./nginx RUN bun run build FROM nginx:stable-alpine as production # copy nginx configuration in side conf.d folder COPY --from=build /usr/src/app/nginx /etc/nginx/conf.d # Copy the build output from the dist folder into the Nginx html directory COPY --from=build /usr/src/app/dist /usr/share/nginx/html # Expose port 80 to allow access to the app EXPOSE 80 # Run Nginx in the foreground ENTRYPOINT ["nginx", "-g", "daemon off;"]