Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@
FROM node:18-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci
RUN npm ci

# 2๋‹จ๊ณ„: ์†Œ์Šค ๋นŒ๋“œ
# 2๋‹จ๊ณ„: ๋นŒ๋“œ (standalone ๋ชจ๋“œ)
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
COPY . .

# Next.js standalone ๋นŒ๋“œ ์ƒ์„ฑ
RUN npm run build

# 3๋‹จ๊ณ„: ํ”„๋กœ๋•์…˜ ์‹คํ–‰ ํ™˜๊ฒฝ
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV production

# ํ”„๋กœ๋•์…˜ ์˜์กด์„ฑ๋งŒ ์žฌ์„ค์น˜
COPY package*.json ./
RUN npm ci --only=production

# ๋นŒ๋“œ ๊ฒฐ๊ณผ๋ฌผ๋งŒ ๋ณต์‚ฌ
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
COPY --from=builder /app/next.config.mjs ./

EXPOSE 3000
CMD ["npm", "start"]
ENV PORT 3000

CMD ["node", "server.js"]
4 changes: 3 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
output: 'standalone',
}

export default nextConfig
Loading