- Remove manual public folder copy - Astro build automatically includes public/ in dist/ - This ensures favicons and other static assets are served Fixes favicon 404 error.
23 lines
389 B
Docker
23 lines
389 B
Docker
# Astro Production Dockerfile
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci --omit=dev
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build Astro project (includes public folder in dist)
|
|
RUN npm run build
|
|
|
|
# Expose port
|
|
EXPOSE 4321
|
|
|
|
# Start Astro preview server
|
|
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "4321"]
|