Skip to content

Commit

Permalink
fix turbo command in docker-files
Browse files Browse the repository at this point in the history
  • Loading branch information
morteako committed Nov 5, 2024
1 parent b2ebf27 commit 1c1ce66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions apps/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn config set prefix ~/.yarn
RUN yarn global add turbo
COPY . .
RUN turbo prune --scope=@dundring/backend --docker
RUN yarn run turbo prune --scope=@dundring/backend --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
Expand All @@ -19,13 +20,15 @@ WORKDIR /app
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
COPY --from=builder root/.yarn/bin/turbo /usr/local/bin/turbo

RUN yarn install --ignore-scripts --frozen-lockfile

# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

RUN yarn turbo run build --filter=@dundring/backend
RUN turbo run build --filter=@dundring/backend

FROM base AS runner
WORKDIR /app
Expand Down
8 changes: 6 additions & 2 deletions apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn config set prefix ~/.yarn
RUN yarn global add turbo
COPY . .
RUN turbo prune --scope=@dundring/frontend --docker

RUN yarn run turbo prune --scope=@dundring/frontend --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
Expand All @@ -19,13 +21,15 @@ WORKDIR /app
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
COPY --from=builder root/.yarn/bin/turbo /usr/local/bin/turbo

RUN yarn install --ignore-scripts --frozen-lockfile

# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

RUN yarn turbo run build --filter=@dundring/frontend
RUN turbo run build --filter=@dundring/frontend

# Use a lightweight web server to serve the static files
FROM nginx:1.25.2-alpine AS runner
Expand Down

0 comments on commit 1c1ce66

Please sign in to comment.