refactor: 웹·앱 공통 코드를 shared 패키지로 분리 (npm workspaces)

- API 클라이언트·토큰 갱신·순수 함수를 shared/ (@nalssigak/shared) 로 옮김
- 토큰 저장소·API 주소는 configureApi 로 플랫폼에서 넣는다 (웹 localStorage)
- 루트 package.json 에 frontend·mobile·shared workspaces, lock 파일 하나로
- 웹 Docker 빌드 대상을 저장소 루트로 (compose context ., 루트 .dockerignore)
This commit is contained in:
minaChoi committed 2026-10-14 14:27:47 +09:00
1 parent 0d6ab29552
commit 2ab2271d61
51 files changed
+15139 -2994

No files matched your search

+13 -5
View File
@@ -2,13 +2,19 @@
# ---- deps: package.json이 바뀔 때만 다시 설치 ----
FROM node:24-alpine AS deps
# 빌드 대상은 저장소 루트(npm workspaces). 웹에 필요한 frontend·shared 만 설치한다
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY frontend/package.json frontend/
COPY shared/package.json shared/
COPY mobile/package.json mobile/
RUN npm ci -w frontend -w shared
# ---- dev: 코드 수정이 바로 반영되는 개발 서버 ----
FROM deps AS dev
COPY . .
COPY shared shared
COPY frontend frontend
WORKDIR /app/frontend
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "5173"]
@@ -18,12 +24,14 @@ ARG VITE_API_BASE_URL=""
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
ARG VITE_SITE_URL=""
ENV VITE_SITE_URL=$VITE_SITE_URL
COPY . .
COPY shared shared
COPY frontend frontend
WORKDIR /app/frontend
RUN npm run build
# ---- prod: nginx로 정적 파일 제공 ----
FROM nginx:1.29-alpine AS prod
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/frontend/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s CMD wget -q -O /dev/null http://127.0.0.1/ || exit 1