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:
parent
c8aab758eb
commit
0f2bee21a9
17
Dockerfile
17
Dockerfile
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue