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

H-3845: Fix Docker set up for Yarn 4 + Node 22 #5973

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,19 @@ HASH_TELEMETRY_DESTINATION=REPLACE_ME.aws.com
# Is used for differentiating different apps, can be any value
HASH_TELEMETRY_APP_ID=hash-app

###########################################
# Disable telemetry from third-party dependencies who transmit IP addresses
NEXT_TELEMETRY_DISABLED=1 # Vercel Next.js
TURBO_TELEMETRY_DISABLED=1 # Vercel Turborepo
YARN_ENABLE_TELEMETRY=0 # Yarn
ARTILLERY_DISABLE_TELEMETRY=true # Artillery
CHECKPOINT_DISABLE=1 # Terraform and others
###########################################
# Vercel Next.js
NEXT_TELEMETRY_DISABLED=1
# Vercel Turborepo
TURBO_TELEMETRY_DISABLED=1
# Yarn
YARN_ENABLE_TELEMETRY=0
# Artillery
ARTILLERY_DISABLE_TELEMETRY=true
# Terraform and others
CHECKPOINT_DISABLE=1

###########################################
## Aliases for dockerized external services
Expand Down
13 changes: 10 additions & 3 deletions apps/hash-ai-worker-ts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@
COPY --from=installer /usr/local/src /usr/local/src
WORKDIR /usr/local/src/apps/hash-ai-worker-ts

ENTRYPOINT [ "yarn", "--cache-folder", "/tmp/yarn-cache", "--global-folder", "/tmp/yarn-global" ]
RUN groupadd --system --gid 60000 hash && \
useradd --system tsworker -G hash

# Set a writable Corepack cache directory
ENV COREPACK_HOME=/usr/local/src/var/corepack-cache
RUN mkdir -p $COREPACK_HOME && \
chown tsworker:hash $COREPACK_HOME && \
corepack enable && corepack prepare --activate

ENTRYPOINT [ "yarn"]
CiaranMn marked this conversation as resolved.
Show resolved Hide resolved
Dismissed Show dismissed Hide dismissed
CMD ["start"]

ARG GOOGLE_CLOUD_WORKLOAD_IDENTITY_FEDERATION_CONFIG_JSON
Expand All @@ -74,8 +83,6 @@
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/* && \
groupadd --system --gid 60000 hash && \
useradd --system tsworker -G hash && \
install -d -m 0775 -o tsworker -g hash /log

RUN mkdir -p officeParserTemp/tempfiles && \
Expand Down
13 changes: 10 additions & 3 deletions apps/hash-integration-worker/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,21 @@
COPY --from=installer /usr/local/src /usr/local/src
WORKDIR /usr/local/src/apps/hash-integration-worker

ENTRYPOINT [ "yarn", "--cache-folder", "/tmp/yarn-cache", "--global-folder", "/tmp/yarn-global" ]
RUN groupadd --system --gid 60000 hash && \
useradd --system integrationworker -G hash

# Set a writable Corepack cache directory
ENV COREPACK_HOME=/usr/local/src/var/corepack-cache
RUN mkdir -p $COREPACK_HOME && \
chown integrationworker:hash $COREPACK_HOME && \
corepack enable && corepack prepare --activate

ENTRYPOINT [ "yarn"]
CiaranMn marked this conversation as resolved.
Show resolved Hide resolved
Dismissed Show dismissed Hide dismissed
CMD ["start"]

RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/* && \
groupadd --system --gid 60000 hash && \
useradd --system integrationworker -G hash && \
install -d -m 0775 -o integrationworker -g hash /log

USER integrationworker:hash
Expand Down
13 changes: 10 additions & 3 deletions infra/docker/api/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,21 @@
WORKDIR /usr/local/src/apps/hash-api
RUN mkdir -p /usr/local/src/var/uploads

ENTRYPOINT [ "yarn", "--cache-folder", "/tmp/yarn-cache", "--global-folder", "/tmp/yarn-global" ]
RUN groupadd --system --gid 60000 hash && \
useradd --system api -G hash

# Set a writable Corepack cache directory
ENV COREPACK_HOME=/usr/local/src/var/corepack-cache
RUN mkdir -p $COREPACK_HOME && \
chown api:hash $COREPACK_HOME && \
corepack enable && corepack prepare --activate

ENTRYPOINT [ "yarn"]
CiaranMn marked this conversation as resolved.
Show resolved Hide resolved
Dismissed Show dismissed Hide dismissed
CMD ["start"]

RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/* && \
groupadd --system --gid 60000 hash && \
useradd --system api -G hash && \
install -d -m 0775 -o api -g hash /log

USER api:hash
Expand Down
Loading