Skip to content

Commit

Permalink
[Fix] 배포 오류 해결
Browse files Browse the repository at this point in the history
[Fix] 배포 오류 해결
  • Loading branch information
seoko97 authored Nov 21, 2024
2 parents a9a1b7f + c216c88 commit 9fbcc54
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
4 changes: 1 addition & 3 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ WORKDIR /app
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml

RUN ls -al

RUN npm install -g pnpm

RUN pnpm install --frozen-lockfile
Expand All @@ -46,4 +44,4 @@ EXPOSE 3001

ENV NODE_ENV=production

CMD ["node", "/app/apps/api/dist/main.js"]
CMD ["node", "/app/apps/api/dist/src/main.js"]
47 changes: 47 additions & 0 deletions apps/media/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM node:18-alpine AS base

FROM base AS builder

RUN apk update

RUN apk add --no-cache libc6-compat

WORKDIR /app

RUN npm install -g pnpm

ENV PNPM_HOME="/root/.local/share/pnpm"
ENV PATH="${PATH}:${PNPM_HOME}"

RUN pnpm install -g turbo@^2.2.3

COPY . .

RUN turbo prune @app/media --docker

FROM base AS runner

RUN apk update

RUN apk add --no-cache libc6-compat python3 py3-pip build-base

WORKDIR /app

COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml

RUN npm install -g pnpm

RUN pnpm install --frozen-lockfile

COPY --from=builder /app/out/full/ .

RUN pnpm build:media

COPY --from=builder /app/apps/media/.env /app/apps/media/dist/.env

EXPOSE 3002

ENV NODE_ENV=production

CMD ["node", "/app/apps/media/dist/src/main.js"]
4 changes: 2 additions & 2 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FROM base AS installer

RUN apk update

RUN apk add --no-cache libc6-compat
RUN apk add --no-cache libc6-compat python3 py3-pip build-base

WORKDIR /app

Expand All @@ -48,4 +48,4 @@ RUN npm install -g serve

EXPOSE 3000

CMD ["serve", "-s", "dist", "-l", "3000"]
CMD ["serve", "-s", "dist", "-l", "3000"]

0 comments on commit 9fbcc54

Please sign in to comment.