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

ci: fix containerfile build for monorepo layout #170

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

conorsch
Copy link
Contributor

Follow-up to #167.

@conorsch conorsch requested a review from ejmg August 13, 2024 20:13
Copy link
Contributor Author

@conorsch conorsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some descriptive comments in-line, to aid in review.

!apps/*/public/
!apps/*/.next/
!apps/*/*.ts
!apps/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line !apps/*/src/ looks to me like it should be sufficient to get the apps/web/src/* directory allowed, but it wasn't working. To resolve, I added !apps/ and I'm calling it a day.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely assumed that !apps/*/src would expand to include any subdirectories so great catch!

@@ -45,7 +45,7 @@ jobs:
with:
context: .
platforms: linux/amd64
file: Containerfile
file: apps/web/Containerfile
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Containerfile moved, but the build "content" did not: the context remains the repo root.

@@ -9,6 +9,7 @@ node_modules
.env.development.local
.env.test.local
.env.production.local
.envrc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use a local .envrc file sometimes to test connecting a locally-built container to a remote DB URL.

@@ -59,6 +62,6 @@ COPY --from=installer /app/apps/web/package.json .
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
# COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT the ./apps/web/public/ dir doesn't exist and doesn't need to exist: the app works well without it.

@@ -4,19 +4,22 @@ LABEL maintainer="[email protected]"

# provide pnpm globally for dep installing and building
FROM alpine AS base
ENV NEXT_TELEMETRY_DISABLED=1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Porting this no-telem env var across all build stages...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, great catch. Very obnoxious to keep track of.

@ejmg
Copy link
Collaborator

ejmg commented Aug 13, 2024

Thanks for the PR and comments 👍

@ejmg ejmg merged commit edb8ba5 into main Aug 13, 2024
1 check passed
@ejmg ejmg deleted the container-build-repair branch August 15, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants