Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(proxy-container): docker builds #9524

Merged
merged 1 commit into from
May 6, 2023
Merged

Conversation

didinele
Copy link
Member

@didinele didinele commented May 6, 2023

Please describe the changes this PR makes and why it should be merged:
Closes #9088

because apparently root cli dev deps were inaccessible in the late stage of yarn ??

either way, once vercel/turborepo#2791 is completely resolved, we can move to something like this:

FROM node:18-alpine as builder

RUN apk update
RUN apk add --no-cache libc6-compat

WORKDIR /usr/proxy

COPY . .
RUN yarn dlx turbo prune --scope=@discordjs/proxy-container --docker

FROM node:18-alpine AS installer

RUN apk update
RUN apk add --no-cache libc6-compat

WORKDIR /usr/proxy

COPY .gitignore .gitignore
COPY .yarn/ .yarn/
COPY .yarnrc.yml .yarnrc.yml
COPY --from=builder /usr/proxy/out/json/ .
COPY --from=builder /usr/proxy/out/yarn.lock ./yarn.lock

RUN yarn install --immutable --inline-builds

COPY tsup.config.ts tsup.config.ts
COPY turbo.json turbo.json
COPY tsconfig.json tsconfig.json
RUN yarn turbo run build --filter=@discordjs/proxy-container

RUN yarn workspaces focus @discordjs/proxy-container --production

FROM node:18-alpine AS runner

WORKDIR /usr/proxy

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

COPY --from=installer /usr/proxy .

CMD ["node", "--enable-source-maps", "packages/proxy-container/dist/index.js"]

Status and versioning classification:

@didinele didinele requested a review from a team as a code owner May 6, 2023 11:44
@didinele didinele requested a review from iCrawl May 6, 2023 11:44
@vercel
Copy link

vercel bot commented May 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated (UTC)
discord-js ⬜️ Ignored (Inspect) May 6, 2023 11:44am
discord-js-guide ⬜️ Ignored (Inspect) May 6, 2023 11:44am

@Jiralite Jiralite linked an issue May 6, 2023 that may be closed by this pull request
@iCrawl iCrawl merged commit 8d5ce32 into main May 6, 2023
@iCrawl iCrawl deleted the fix/proxy-container-build branch May 6, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Publish dev docker images action failing
2 participants