clean up environment and paths

This commit is contained in:
Milo Schwartz
2024-09-29 21:09:35 -04:00
parent 327175a799
commit db76769fb7
7 changed files with 16 additions and 25 deletions

View File

@@ -1,36 +1,26 @@
# Stage 1: Build the application
FROM node:18-alpine AS builder
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application code
COPY . .
# Build the Next.js application and compile TypeScript
RUN npm run build
# Stage 2: Run the application
FROM node:18-alpine AS runner
RUN apk add --no-cache curl
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install only production dependencies
RUN npm ci --only=production
# Copy built application from the builder stage
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/dist ./dist
# Start the application
CMD ["npm", "start"]