fix(docker): resolve @cc-platform/server file: dep in container build

Use additional_contexts to copy platform server package into the Docker
build context. Rewrites the file: dependency path and removes the
lockfile so npm install can resolve the local package correctly.
Applied to both production and dev Dockerfiles.
This commit is contained in:
MayaTheShy
2026-03-28 22:35:53 -04:00
parent ed612f3e38
commit f008a9e665
4 changed files with 20 additions and 0 deletions

View File

@@ -3,12 +3,20 @@ FROM node:18-alpine
WORKDIR /app
# Copy platform server package from additional build context
COPY --from=platform-server . /app/platform-server/
RUN rm -rf /app/platform-server/node_modules
# Install nodemon for hot reload
RUN npm install -g nodemon
# Copy package files
COPY package*.json ./
# Rewrite file: dependency to use the local copy inside the container
RUN sed -i 's|file:../../cc-platform-core/server|file:./platform-server|' package.json \
&& rm -f package-lock.json
# Install all dependencies (including dev)
RUN npm install