Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyatea authored Feb 3, 2025
1 parent f2a3f89 commit 9eee936
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ARG NODE_VERSION=22.11.0-bullseye

FROM --platform=$BUILDPLATFORM node:${NODE_VERSION} AS native-builder

ENV COREPACK_DEFAULT_TO_LATEST=0

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
Expand All @@ -16,7 +14,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
&& apt-get install -yqq --no-install-recommends \
build-essential

RUN corepack enable
RUN npm install -g [email protected] && pnpm install

WORKDIR /type4ny

Expand Down Expand Up @@ -46,13 +44,11 @@ RUN rm -rf .git/

FROM --platform=$TARGETPLATFORM node:${NODE_VERSION} AS target-builder

ENV COREPACK_DEFAULT_TO_LATEST=0

RUN apt-get update \
&& apt-get install -yqq --no-install-recommends \
build-essential

RUN corepack enable
RUN npm install -g [email protected] && pnpm install

WORKDIR /type4ny

Expand All @@ -78,7 +74,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ffmpeg tini curl libjemalloc-dev libjemalloc2 \
&& ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so \
&& corepack enable \
&& npm install -g [email protected] && pnpm install \
&& groupadd -g "${GID}" type4ny \
&& useradd -l -u "${UID}" -g "${GID}" -m -d /type4ny type4ny \
&& find / -type d -path /sys -prune -o -type d -path /proc -prune -o -type f -perm /u+s -ignore_readdir_race -exec chmod u-s {} \; \
Expand All @@ -91,7 +87,7 @@ WORKDIR /type4ny

# add package.json to add pnpm
COPY --chown=type4ny:type4ny ./package.json ./package.json
RUN corepack install
RUN npm install -g [email protected] && pnpm install

COPY --chown=type4ny:type4ny --from=target-builder /type4ny/node_modules ./node_modules
COPY --chown=type4ny:type4ny --from=target-builder /type4ny/packages/backend/node_modules ./packages/backend/node_modules
Expand Down

0 comments on commit 9eee936

Please sign in to comment.