Setup project structure with React, Tailwind CSS, and TypeScript for a multi-theme portfolio application. Includes mock data definitions, environment configuration, and Vite build tooling.
40 lines
793 B
Docker
40 lines
793 B
Docker
# Build Stage
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy dependency manifests
|
|
COPY package*.json ./
|
|
|
|
# Install all dependencies
|
|
RUN npm ci
|
|
|
|
# Copy full application codebase
|
|
COPY . .
|
|
|
|
# Compile frontend and bundle backend files
|
|
RUN npm run build
|
|
|
|
# Production alpine stage
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy configuration files
|
|
COPY package*.json ./
|
|
|
|
# Install only production dependencies (Express, dotenv, @google/genai)
|
|
RUN npm ci --only=production
|
|
|
|
# Copy compiled build resources from builder stage
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/data ./data
|
|
|
|
# Expose port (Internal container routing to 3000)
|
|
EXPOSE 3000
|
|
|
|
ENV NODE_ENV=production
|
|
ENV ADMIN_PASSWORD=autor2026
|
|
|
|
# Execute standalone node production entrypoint
|
|
CMD ["node", "dist/server.cjs"]
|