FROM node:22.12.0-alpine
# corepack is upgraded before anything else: the version bundled with Node is
# older than the registry's current signing keys, so it fails to verify any
# pnpm a project pins through package.json "packageManager".
RUN apk add --no-cache bash git libc6-compat \
&& npm install -g corepack@latest \
&& corepack enable \
&& corepack prepare pnpm@9.15.4 --activate
# The project's own pnpm is fetched on demand; never stop to ask about it.
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
# Non-interactive installs (no "remove node_modules?" TTY prompt in compose).
# Installs must never prompt. The entrypoint unsets this before starting Metro:
# Expo reads CI and disables watch mode when it is set.
ENV CI=true
ENV PNPM_HOME=/pnpm
ENV PATH=$PNPM_HOME:$PATH
ENV PNPM_STORE_DIR=/pnpm-store
WORKDIR /app
COPY entrypoint.sh mobile-stack.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/mobile-stack.sh
EXPOSE 5173 5174 5175 8081
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]