mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-07-27 15:45:21 +00:00
38 lines
719 B
Docker
38 lines
719 B
Docker
![]() |
# Frontend Dockerfile - React/Vite application
|
||
|
FROM node:20-alpine AS build
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
# Copy package files
|
||
|
COPY package*.json ./
|
||
|
|
||
|
# Install dependencies
|
||
|
RUN npm ci
|
||
|
|
||
|
# Copy source code
|
||
|
COPY . .
|
||
|
|
||
|
# Build the application
|
||
|
RUN npm run build
|
||
|
|
||
|
# Production stage
|
||
|
FROM nginx:alpine
|
||
|
|
||
|
# Copy built files from build stage
|
||
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||
|
|
||
|
# Copy nginx configuration and entrypoint
|
||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||
|
COPY entrypoint.sh /entrypoint.sh
|
||
|
|
||
|
# Make entrypoint executable
|
||
|
RUN chmod +x /entrypoint.sh
|
||
|
|
||
|
# Expose port 80 (standard HTTP port)
|
||
|
EXPOSE 80
|
||
|
|
||
|
# Environment variables for flexibility
|
||
|
ENV BACKEND_URL=http://backend:8080
|
||
|
|
||
|
# Use custom entrypoint
|
||
|
ENTRYPOINT ["/entrypoint.sh"]
|