Skip to content

Commit

Permalink
fix: use corepack in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Nov 20, 2024
1 parent d55280c commit a431d53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ RUN apk add --no-cache \

WORKDIR ${DIR}

COPY ./.yarn ${DIR}.yarn
#COPY ./.yarn ${DIR}.yarn
COPY ./package.json ./yarn.lock ./.yarnrc.yml ${DIR}/

RUN chown -R node:node ${DIR}
# Do not run service as root
USER node

RUN yarn workspaces focus --all --production
RUN corepack yarn workspaces focus --all --production

# Launch entrypoint with dumb-init
# Remap SIGTERM to SIGINT https://github.com/Yelp/dumb-init#signal-rewriting
ENTRYPOINT ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "yarn", "run"]
ENTRYPOINT ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "corepack", "yarn", "run"]
CMD ["start"]

FROM base AS build
ARG DIR

# Install dev deps too
RUN yarn install --immutable
RUN corepack yarn install --immutable

COPY . ${DIR}

# Build code
RUN yarn build --verbose
RUN corepack yarn build --verbose

FROM base AS production
ARG DIR
Expand Down

0 comments on commit a431d53

Please sign in to comment.