mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-24 13:56:39 +00:00
clean up environment and paths
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user