Skip to content

Commit 049394e

Browse files
authored
Update dockerfile to not include optional deps (redhat-developer#238)
* Update dockerfile to use --ignore-optional Signed-off-by: Paul Schultz <[email protected]> Update dockerfile to use --ignore-optional Signed-off-by: Paul Schultz <[email protected]> * Update docker build action to not use cache for workflow dispatch Signed-off-by: Paul Schultz <[email protected]> --------- Signed-off-by: Paul Schultz <[email protected]>
1 parent fedcc2b commit 049394e

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*.less eol=lf
77
*.styl eol=lf
88
*.js eol=lf
9+
*.cjs eol=lf
910
*.ts eol=lf
1011
*.jsx eol=lf
1112
*.tsx eol=lf

.github/workflows/docker-build.yaml

+11-4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ jobs:
8383
tags: type=sha
8484

8585
- name: Build and push Docker image
86+
if: github.event_name == 'workflow_dispatch'
87+
uses: docker/build-push-action@v4
88+
with:
89+
context: .
90+
push: ${{ github.event_name == 'push' }}
91+
provenance: false
92+
tags: ${{ steps.meta.outputs.tags }}
93+
labels: ${{ steps.meta.outputs.labels }}
94+
95+
- name: Build and push Docker image
96+
if: github.event_name != 'workflow_dispatch'
8697
uses: docker/build-push-action@v4
8798
with:
8899
context: .
@@ -92,10 +103,6 @@ jobs:
92103
labels: ${{ steps.meta.outputs.labels }}
93104
cache-from: type=local,src=/tmp/.buildx-cache
94105
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
95-
build-args: |
96-
TECHDOCS_BUILDER_TYPE=external
97-
TECHDOCS_GENERATOR_TYPE=local
98-
TECHDOCS_PUBLISHER_TYPE=awsS3
99106

100107
- # Temp fix
101108
# https://github.com/docker/build-push-action/issues/252

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ COPY .yarnrc.yml ./
1414
RUN find packages -mindepth 2 -maxdepth 2 \! -name "package.json" -exec rm -rf {} \+
1515

1616
ENV IS_CONTAINER="TRUE"
17-
RUN $YARN install --frozen-lockfile --network-timeout 600000
17+
RUN $YARN add -D -W --arch=x64 --platform=linux turbo
18+
RUN $YARN add -D -W --arch=x64 --platform=linux @esbuild/linux-x64
19+
RUN $YARN install --frozen-lockfile --network-timeout 600000 --ignore-optional
1820

1921
# Stage 2 - Build packages
2022
FROM registry.access.redhat.com/ubi9/nodejs-18-minimal:latest AS build
@@ -59,7 +61,7 @@ RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
5961

6062
# Install production dependencies
6163
ENV IS_CONTAINER="TRUE"
62-
RUN $YARN install --frozen-lockfile --production --network-timeout 600000 && $YARN cache clean
64+
RUN $YARN install --frozen-lockfile --production --network-timeout 600000 --ignore-optional && $YARN cache clean
6365

6466
# Copy the built packages from the build stage
6567
COPY --from=build /opt/app-root/src/packages/backend/dist/bundle.tar.gz .

0 commit comments

Comments
 (0)