-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.admin
More file actions
41 lines (30 loc) · 812 Bytes
/
Dockerfile.admin
File metadata and controls
41 lines (30 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# ========================================
# Dockerfile for Admin Panel (Next.js)
# ========================================
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY admin/package*.json ./
RUN npm ci
# Copy source
COPY admin/ ./
# Build Next.js
RUN npm run build
# ========================================
# Production stage
# ========================================
FROM node:20-alpine
WORKDIR /app
# Copy built app
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/next.config.js ./
# Install production dependencies only
RUN npm ci --only=production
# Expose port
EXPOSE 3001
ENV NODE_ENV=production
ENV PORT=3001
# Start Next.js
CMD ["npm", "start", "--", "-p", "3001"]