Dockerfile (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# Stage 1: Build the Astro app FROM node:18-alpine AS build WORKDIR /usr/src/app # Install dependencies COPY package*.json ./ RUN npm install # Copy the rest of the app COPY . . # Build the Astro app RUN npm run build # Stage 2: Serve the app using nginx FROM nginx:alpine # Copy built files to nginx's html directory COPY --from=build /usr/src/app/dist /usr/share/nginx/html # Expose port 80 EXPOSE 80 # Start nginx CMD ["nginx", "-g", "daemon off;"] |