Files
www.cialloo.com/Dockerfile
cialloo 7f58c9c847
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 17s
feat: add S3 configuration and utility functions for blog image handling
2025-10-26 07:56:19 +08:00

41 lines
756 B
Docker

# Build stage
FROM node:24-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy project files
COPY . .
# Build arguments for environment variables
ARG VITE_S3_ENDPOINT_BLOG
ARG VITE_S3_BUCKET_BLOG
# Set environment variables for Vite build
ENV VITE_S3_ENDPOINT_BLOG=${VITE_S3_ENDPOINT_BLOG}
ENV VITE_S3_BUCKET_BLOG=${VITE_S3_BUCKET_BLOG}
# Build the application
RUN npm run build
# Production stage
FROM nginx:alpine
# Copy built assets from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]