14 lines
668 B
Docker
14 lines
668 B
Docker
# Reusable build environment. The source is bind-mounted, not copied.
|
|
FROM node:current-slim
|
|
|
|
WORKDIR /app
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
|
# Lets pnpm purge a stale bind-mounted node_modules without a TTY prompt.
|
|
ENV CI=true
|
|
|
|
RUN npm install -g --force corepack && corepack enable
|
|
|
|
CMD ["sh", "-c", "pnpm install --frozen-lockfile && pnpm run build && find .output -type f -name '*.map' -delete && find .output -type f \\( -name '*.js' -o -name '*.mjs' -o -name '*.css' \\) -exec sed -i -e '/^[[:space:]]*\\/\\/# sourceMappingURL=.*$/d' -e '/^[[:space:]]*\\/\\*# sourceMappingURL=.*\\*\\/[[:space:]]*$/d' {} +"]
|