Skip to content

Commit

Permalink
Merge pull request #63 from jeiltodo/feature/57-docker
Browse files Browse the repository at this point in the history
#57 feat: dockerfile 작성
  • Loading branch information
Dragonite-Lee authored Aug 16, 2024
2 parents 9d3cfc4 + 3d62fd2 commit 78458d7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apps/admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:18-alpine AS deps
WORKDIR /app
COPY package.json yarn.lock ./
COPY apps/admin/package.json ./apps/admin/
COPY packages/*/package.json ./packages/*/
RUN yarn install --frozen-lockfile --production

FROM node:18-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build --filter=apps/admin

FROM node:18-alpine AS runner
WORKDIR /app

COPY --from=builder /app/apps/admin/.next ./.next
COPY --from=builder /app/apps/admin/public ./public
COPY --from=builder /app/apps/admin/package.json ./package.json
COPY --from=builder /app/packages ./packages

EXPOSE 3001
CMD ["yarn", "start"]
23 changes: 23 additions & 0 deletions apps/user/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:18-alpine AS deps
WORKDIR /app
COPY package.json yarn.lock ./
COPY apps/user/package.json ./apps/user/
COPY packages/*/package.json ./packages/*/
RUN yarn install --frozen-lockfile --production

FROM node:18-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build --filter=apps/user

FROM node:18-alpine AS runner
WORKDIR /app

COPY --from=builder /app/apps/user/.next ./.next
COPY --from=builder /app/apps/user/public ./public
COPY --from=builder /app/apps/user/package.json ./package.json
COPY --from=builder /app/packages ./packages

EXPOSE 3000
CMD ["yarn", "start"]

0 comments on commit 78458d7

Please sign in to comment.