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: Add support for npm cache #95

Merged
merged 1 commit into from
Jul 1, 2024
Merged

feat: Add support for npm cache #95

merged 1 commit into from
Jul 1, 2024

Conversation

staticaland
Copy link
Collaborator

@staticaland staticaland commented Jun 29, 2024

feat: Add support for npm cache.

Random notes

Remove any USER instructions that make no difference because it's a multi stage build.

RUN --mount=type=cache,id=npm-cache,sharing=locked,target=/root/.npm \
    npm clean-install

Also:

FROM nginxinc/nginx-unprivileged:1.27-alpine3.19-slim@sha256:40e17e5d27afecf49dd3545389bc57e9a79fe379cb4934cd0639727cdb638954 AS final

Also:

  mount_points = [
    {
      sourceVolume  = "init-etc-nginx"
      containerPath = "/etc/nginx"
      readOnly      = false
    },
    {
      sourceVolume  = "init-var-cache-nginx"
      containerPath = "/var/cache/nginx"
      readOnly      = false
    },
    {
      sourceVolume  = "init-tmp"
      containerPath = "/tmp"
      readOnly      = false
    }
  ]

Also:

The init container.

Also:

  additional_main_container_dependencies = [{
    containerName = "set-mount-permissions"
    condition     = "SUCCESS"
  }]

  additional_container_definitions = {
    init_container                = local.init_container                # Changes permissions of directories that can't be read only
  }

@staticaland staticaland requested a review from a team as a code owner June 29, 2024 07:55
@staticaland staticaland merged commit 20bede7 into main Jul 1, 2024
1 check passed
@staticaland staticaland deleted the npm-cache branch July 1, 2024 07:47
@github-actions github-actions bot mentioned this pull request Jul 1, 2024
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.

1 participant