From 26fd50a4eff460f54b6bf183a387fac652151769 Mon Sep 17 00:00:00 2001 From: kimyu0218 Date: Sat, 2 Mar 2024 04:29:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B3=B5=EC=9A=A9=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EB=AA=BB=20=EC=B0=BE=EB=8A=94=20=EB=AC=B8=EC=A0=9C?= =?UTF-8?q?=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - link가 배포환경에서 동작하지 않음 - link 대신 빌드본(dist)을 node_modules로 복사하는 방식으로 대체 --- backend/Dockerfile.signal | 11 ++++------- backend/Dockerfile.was | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/backend/Dockerfile.signal b/backend/Dockerfile.signal index 42a7e4a0..8b962abe 100644 --- a/backend/Dockerfile.signal +++ b/backend/Dockerfile.signal @@ -8,20 +8,17 @@ COPY package*.json ./ RUN npm ci COPY packages ./ -RUN cd socket-event && \ - npm ci && npm run build && npm link && \ - cd .. -RUN cd winston-logger && \ - npm ci && npm run build && npm link && \ - cd .. +RUN npm run build-prod:logger +RUN npm run build-prod:event WORKDIR /app/signal COPY signal/package*.json ./ RUN npm ci +RUN mv ../socket-event/dist ./node_modules/socket-event +RUN mv ../winston-logger/dist ./node_modules/winston-logger COPY signal . -RUN npm link socket-event && npm link winston-logger RUN npm run build CMD ["tini", "--", "npm", "run", "start:prod"] \ No newline at end of file diff --git a/backend/Dockerfile.was b/backend/Dockerfile.was index e5a8f821..32b22430 100644 --- a/backend/Dockerfile.was +++ b/backend/Dockerfile.was @@ -8,20 +8,17 @@ COPY package*.json ./ RUN npm ci COPY packages ./ -RUN cd socket-event && \ - npm ci && npm run build && npm link && \ - cd .. -RUN cd winston-logger && \ - npm ci && npm run build && npm link && \ - cd .. +RUN npm run build-prod:logger +RUN npm run build-prod:event WORKDIR /app/was COPY was/package*.json ./ RUN npm ci +RUN mv ../socket-event/dist ./node_modules/socket-event +RUN mv ../winston-logger/dist ./node_modules/winston-logger COPY was . -RUN npm link socket-event && npm link winston-logger RUN npm run build CMD ["tini", "--", "npm", "run", "start:prod"] \ No newline at end of file