Skip to content

Commit

Permalink
fix: 공용 패키지 못 찾는 문제 해결
Browse files Browse the repository at this point in the history
- link가 배포환경에서 동작하지 않음
- link 대신 빌드본(dist)을 node_modules로 복사하는 방식으로 대체
  • Loading branch information
kimyu0218 committed Mar 1, 2024
1 parent c9ebaf2 commit 26fd50a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
11 changes: 4 additions & 7 deletions backend/Dockerfile.signal
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
11 changes: 4 additions & 7 deletions backend/Dockerfile.was
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 26fd50a

Please sign in to comment.