* 🚀 refactor: simplify deployment process in workflow file * 🚀 chore: add IMAGE_NAME to GITHUB_ENV for deployment workflow * ✨ chore: simplify deployment logging in workflow file * 🚀 fix: correct container name in deployment script logic * 🚀 refactor: rename job and streamline deployment steps * Update README.md * ✨ fix: prevent multiple form submissions in Contact component * ✨ feat: honeypot and timestamp checks to form submission * ✨ refactor: simplify contact form and improve UI elements * ✨ feat: add responsive masonry layout for projects display * ✨ style: Update project title size and improve layout visibility * ✨ fix: remove unnecessary test assertions and improve act usage * ✨ chore: add @types/react-responsive-masonry package fixing with this import error on building * ✨ chore: remove unused dev dependencies from package-lock.json * ✨ refactor: update environment variable usage and add caching * ✨ refactor: update environment variables and dependencies * ✨ chore: streamline Dockerfile and remove redundant steps * ✨ chore: add type definitions for node-fetch in Dockerfile
41 lines
960 B
Docker
41 lines
960 B
Docker
# Stage 1: Build
|
|
FROM node:current-alpine AS builder
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package.json and package-lock.json
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies including development dependencies
|
|
RUN npm install
|
|
|
|
# Copy the application code
|
|
COPY . .
|
|
|
|
# Install type definitions for react-responsive-masonry and node-fetch
|
|
RUN npm install --save-dev @types/react-responsive-masonry @types/node-fetch
|
|
|
|
# Build the Next.js application
|
|
RUN npm run build
|
|
|
|
# Stage 2: Production
|
|
FROM node:current-alpine
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy only the necessary files from the build stage
|
|
COPY --from=builder /app/package*.json ./
|
|
COPY --from=builder /app/.next ./.next
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/.env .env
|
|
|
|
# Install only production dependencies
|
|
RUN npm install --only=production
|
|
|
|
# Expose the port the app runs on
|
|
EXPOSE 3000
|
|
|
|
# Run the app with the start script
|
|
ENTRYPOINT [ "npm", "run", "start" ] |