Skip to content

Commit b1d9860

Browse files
mrTuomoKcursoragent
andcommitted
fix(docker): reduce OpenShift build memory for pnpm review images
Scope pnpm install to the target app workspace graph. Skip static page generation on review builds to avoid OOM. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d5e5a88 commit b1d9860

4 files changed

Lines changed: 41 additions & 34 deletions

File tree

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ RUN npm install -g pnpm@11.5.1
135135

136136
USER default
137137

138-
RUN pnpm install --frozen-lockfile
138+
# Install only the target app and its workspace dependency graph (pnpm equivalent of
139+
# yarn workspaces focus). Skips other apps/proxies to reduce memory during next build.
140+
ENV HUSKY=0
141+
RUN pnpm install --frozen-lockfile --filter ${PROJECT}...
139142
RUN pnpm --filter ${PROJECT} run share-static-hardlink
143+
ENV SKIP_BUILD_STATIC_GENERATION=${SKIP_BUILD_STATIC_GENERATION}
140144
RUN pnpm --filter ${PROJECT} run build
141145

142146
# Does not play well with buildkit on CI

pipelines/harrastukset-ui-review.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
trigger: none
99

1010
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
11-
# opened with one of the specified target branches, or when updates are made to
11+
# opened with one of the specified target branches, or when updates are made to
1212
# such a pull request.
1313
#
14-
# GitHub creates a new ref when a pull request is created. The ref points to a
15-
# merge commit, which is the merged code between the source and target branches
14+
# GitHub creates a new ref when a pull request is created. The ref points to a
15+
# merge commit, which is the merged code between the source and target branches
1616
# of the pull request.
1717
#
18-
# Opt out of pull request validation
18+
# Opt out of pull request validation
1919
pr:
2020
# PR target branch
2121
branches:
2222
include:
23-
- main
23+
- main
2424
paths:
2525
exclude:
26-
- '*release-please*'
27-
- '*.md'
28-
- '.github/'
29-
- 'pipelines/harrastukset-ui-release.yml'
30-
- 'pipelines/harrastukset-ui-dev.yml'
31-
- '*compose*'
26+
- '*release-please*'
27+
- '*.md'
28+
- '.github/'
29+
- 'pipelines/harrastukset-ui-release.yml'
30+
- 'pipelines/harrastukset-ui-dev.yml'
31+
- '*compose*'
3232

3333
# By default, use self-hosted agents
3434
pool: Default
@@ -49,6 +49,7 @@ extends:
4949
# Does not contain all buildArguments, the rest located in harrastukset-pipelines/harrastukset-variables-development.yml and harrastukset-variables-common.yml
5050
# The values here will override the values defined in the harrastukset-pipelines repository
5151
buildArgs:
52+
SKIP_BUILD_STATIC_GENERATION: 1
5253
FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-hobbies.dev.hel.ninja/
5354
CMS_ORIGIN: https://harrastus.app-staging.hkih.hion.dev
5455
LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event

pipelines/liikunta-ui-review.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
trigger: none
99

1010
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
11-
# opened with one of the specified target branches, or when updates are made to
11+
# opened with one of the specified target branches, or when updates are made to
1212
# such a pull request.
1313
#
14-
# GitHub creates a new ref when a pull request is created. The ref points to a
15-
# merge commit, which is the merged code between the source and target branches
14+
# GitHub creates a new ref when a pull request is created. The ref points to a
15+
# merge commit, which is the merged code between the source and target branches
1616
# of the pull request.
1717
#
18-
# Opt out of pull request validation
18+
# Opt out of pull request validation
1919
pr:
2020
# PR target branch
2121
branches:
2222
include:
23-
- main
23+
- main
2424
paths:
2525
exclude:
26-
- '*release-please*'
27-
- '*.md'
28-
- '.github/'
29-
- 'pipelines/liikunta-ui-release.yml'
30-
- 'pipelines/liikunta-ui-dev.yml'
31-
- '*compose*'
26+
- '*release-please*'
27+
- '*.md'
28+
- '.github/'
29+
- 'pipelines/liikunta-ui-release.yml'
30+
- 'pipelines/liikunta-ui-dev.yml'
31+
- '*compose*'
3232

3333
# By default, use self-hosted agents
3434
pool: Default
@@ -49,6 +49,7 @@ extends:
4949
# Does not contain all buildArguments, the rest located in liikunta-pipelines/liikunta-variables-development.yml and liikunta-variables-common.yml
5050
# The values here will override the values defined in the liikunta-pipelines repository
5151
buildArgs:
52+
SKIP_BUILD_STATIC_GENERATION: 1
5253
FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-sports.dev.hel.ninja/
5354
CMS_ORIGIN: https://liikunta.app-staging.hkih.hion.dev
5455
LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event

pipelines/tapahtumat-ui-review.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
trigger: none
99

1010
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
11-
# opened with one of the specified target branches, or when updates are made to
11+
# opened with one of the specified target branches, or when updates are made to
1212
# such a pull request.
1313
#
14-
# GitHub creates a new ref when a pull request is created. The ref points to a
15-
# merge commit, which is the merged code between the source and target branches
14+
# GitHub creates a new ref when a pull request is created. The ref points to a
15+
# merge commit, which is the merged code between the source and target branches
1616
# of the pull request.
1717
#
18-
# Opt out of pull request validation
18+
# Opt out of pull request validation
1919
pr:
2020
# PR target branch
2121
branches:
2222
include:
23-
- main
23+
- main
2424
paths:
2525
exclude:
26-
- '*release-please*'
27-
- '*.md'
28-
- '.github/'
29-
- 'pipelines/tapahtumat-ui-release.yml'
30-
- 'pipelines/tapahtumat-ui-dev.yml'
31-
- '*compose*'
26+
- '*release-please*'
27+
- '*.md'
28+
- '.github/'
29+
- 'pipelines/tapahtumat-ui-release.yml'
30+
- 'pipelines/tapahtumat-ui-dev.yml'
31+
- '*compose*'
3232

3333
# By default, use self-hosted agents
3434
pool: Default
@@ -49,6 +49,7 @@ extends:
4949
# Does not contain all buildArguments, the rest located in tapahtumat-pipelines/tapahtumat-variables-development.yml and tapahtumat-variables-common.yml
5050
# The values here will override the values defined in the tapahtumat-pipelines repository
5151
buildArgs:
52+
SKIP_BUILD_STATIC_GENERATION: 1
5253
FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-events.dev.hel.ninja/
5354
CMS_ORIGIN: https://tapahtumat.app-staging.hkih.hion.dev
5455
LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event

0 commit comments

Comments
 (0)