Don't know how to deploy with turborepo

3 months ago

Hello, i'm trouble shooting on how to deploy with turbo repo; how can i deploy it

next path: /apps/musy-client

docker file:

FROM node:20-alpine AS base

FROM base AS builder

Install dependencies needed for build

RUN apk update && apk add --no-cache libc6-compat
WORKDIR /app

Install pnpm and turbo

RUN npm install -g pnpm turbo

Copy all files for pruning

COPY . .
RUN turbo prune musy-client --docker

FROM base AS installer
RUN apk update && apk add --no-cache libc6-compat
WORKDIR /app

Install dependencies

COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install --frozen-lockfile

Build the project

COPY --from=builder /app/out/full/ .
RUN pnpm turbo build --filter=musy-client…

FROM base AS runner
WORKDIR /app

Don't run production as root

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

Copy built application

COPY --from=installer --chown=nextjs:nodejs /app/apps/musy-client/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/musy-client/.next/static ./apps/musy-client/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/musy-client/public ./apps/musy-client/public

ENV PORT=3000
ENV HOSTNAME=0.0.0.0

EXPOSE 3000

CMD node apps/musy-client/server.js

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

1 Replies

3 months ago

Hello,

Looks like you have both services online and responding, awsome!

Going to mark this as solved, but feel free to re-open if you have any questions!

Best,
Brody


Status changed to Solved brody 3 months ago