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

feat: Improve docs on deployment with Docker #1915

Open
titi-lima opened this issue Jun 15, 2024 · 0 comments
Open

feat: Improve docs on deployment with Docker #1915

titi-lima opened this issue Jun 15, 2024 · 0 comments
Labels
🌟 enhancement New feature or request

Comments

@titi-lima
Copy link

Is your feature request related to a problem? Please describe.

The current Dockerfile implementation suggested by the docs could use some more love; currently, there's a runtime error associated with it and poor usage of caching make for significantly longer build times.

Describe the solution you'd like to see

There should be a base step that runs RUN apk add --no-cache libc6-compat openssl and is reused by the other steps to address the runtime error. Also, caching pnpm installs, next builds via a bind mount and leveraging Docker's cache to move around some of the steps could significantly improve performance.

Describe alternate solutions

Maybe bind mounts are a bit too much as I believe you'd have to mount one for pnpm regardless of the package manager used (though I believe that's an important step -- it's a 6x speed boost on a pretty average-sized project I'm developing), but I'm willing to open a PR with the other solutions too :)

Additional information

  1. The Runner stage does not include the openssl package as it uses a different image, which results in a runtime error.
  2. The install step is not cached, ocurring in significant delays.
  3. Separating the Builder and Deps stage when there's a dependency from the Builder stage on the Deps's node_modules introduces unnecessary overhead, as there already is a Runner layer;
  4. Not separating the prisma generate step from the install step occurs in a fresh install of the dependencies every time my prisma.schema changes.
@titi-lima titi-lima added the 🌟 enhancement New feature or request label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant