npm to pnpm
This commit is contained in:
@@ -3,3 +3,4 @@ dist/
|
|||||||
*.log
|
*.log
|
||||||
.env
|
.env
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.pnpm-store
|
||||||
|
|||||||
+45
-13
@@ -1,22 +1,54 @@
|
|||||||
FROM node:20-slim AS builder
|
# MetaMesh Plugin: filename-parser
|
||||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
# Parses video filenames to extract metadata
|
||||||
WORKDIR /app
|
|
||||||
COPY package.json tsconfig.json ./
|
|
||||||
RUN npm install
|
|
||||||
# Build the git dependency (filename-tools)
|
|
||||||
RUN cd node_modules/@metazla/filename-tools && npm install && npm run build
|
|
||||||
COPY src/ ./src/
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM node:20-slim
|
FROM node:20-slim AS builder
|
||||||
|
|
||||||
|
# Install git for GitHub dependencies
|
||||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN npm install -g corepack@latest && corepack enable
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json ./
|
|
||||||
RUN npm install --omit=dev
|
# Copy package files first for layer caching
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
RUN corepack install
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# Build the git dependency (filename-tools)
|
||||||
|
RUN cd node_modules/@metazla/filename-tools && pnpm install && pnpm run build
|
||||||
|
|
||||||
|
# Copy source and build
|
||||||
|
COPY tsconfig.json ./
|
||||||
|
COPY src/ ./src/
|
||||||
|
RUN pnpm run build
|
||||||
|
|
||||||
|
# Production image
|
||||||
|
FROM node:20-slim
|
||||||
|
|
||||||
|
# Install git for GitHub dependencies
|
||||||
|
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN npm install -g corepack@latest && corepack enable
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
RUN corepack install
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prod
|
||||||
|
|
||||||
# Build the git dependency in production too
|
# Build the git dependency in production too
|
||||||
RUN cd node_modules/@metazla/filename-tools && npm install && npm run build
|
RUN cd node_modules/@metazla/filename-tools && pnpm install && pnpm run build
|
||||||
|
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||||
CMD node -e "require('http').get('http://localhost:8080/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
|
CMD node -e "require('http').get('http://localhost:8080/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
|
|||||||
Generated
-2683
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@metazla/plugin-filename-parser",
|
"name": "@metazla/plugin-filename-parser",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"packageManager": "[email protected]",
|
||||||
"description": "MetaMesh plugin: Parses video filenames to extract metadata",
|
"description": "MetaMesh plugin: Parses video filenames to extract metadata",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
Generated
+1591
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user