# Use Node.js base image for build stage FROM node:20.12.2 AS build # Set working directory WORKDIR /app # Copy package.json and yarn.lock files COPY package.json ./ # Install dependencies using Yarn RUN npm i # Copy the rest of the application code COPY . . # Build the application RUN npm run build # Use Nginx base image for final stage FROM nginx:alpine # Copy the static files from the SvelteKit app's build output directory into the Nginx server directory COPY --from=build /app/dist/client /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf # Expose port 80 EXPOSE 80 # Start Nginx server CMD ["nginx", "-g", "daemon off;"]