fix: use parent context in Docker build for encryptid-sdk dependency

The file: link to ../encryptid-sdk requires the build context to be
the parent directory so Docker can access the SDK as a sibling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-17 16:08:48 -07:00
parent c8aab758eb
commit 0f2bee21a9
2 changed files with 13 additions and 8 deletions

View File

@ -1,20 +1,25 @@
# rMaps.online - Friend-finding navigation
# Multi-stage build for optimized production image
FROM node:20-alpine AS base
# Stage 1: Dependencies
FROM node:20-alpine AS deps
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY rmaps-online/package.json rmaps-online/package-lock.json* ./
# Copy local SDK dependency (package.json references file:../encryptid-sdk)
COPY encryptid-sdk /encryptid-sdk/
RUN npm ci || npm install
# Stage 2: Build
FROM node:20-alpine AS builder
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
COPY --from=deps /encryptid-sdk /encryptid-sdk
COPY rmaps-online/ .
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
@ -22,7 +27,7 @@ ENV NODE_ENV=production
RUN npm run build
# Stage 3: Production
FROM node:20-alpine AS runner
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production

View File

@ -3,8 +3,8 @@ version: '3.8'
services:
rmaps:
build:
context: .
dockerfile: Dockerfile
context: ..
dockerfile: rmaps-online/Dockerfile
container_name: rmaps-online
restart: unless-stopped
environment: