refactor: convert repository to monorepo with npm workspaces
Restructured the repository into a monorepo to better organize application code and maintenance scripts. ## Workspace Structure - web-app: Next.js application (all app code moved from root) - housekeeping: Database backup and maintenance scripts ## Key Changes - Moved all application code to web-app/ using git mv - Moved database scripts to housekeeping/ workspace - Updated Dockerfile for monorepo build process - Updated docker-compose files (volume paths: ./web-app/etc/hosts/) - Updated .gitignore for workspace-level node_modules - Updated documentation (README.md, CLAUDE.md, CHANGELOG.md) ## Migration Impact - Root package.json now manages workspaces - Build commands delegate to web-app workspace - All file history preserved via git mv - Docker build process updated for workspace structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
21
Dockerfile
21
Dockerfile
@@ -12,17 +12,20 @@ RUN apk add --no-cache libc6-compat
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# package.json and package-lock.json
|
||||
# Copy monorepo root package files
|
||||
COPY ./package.json ./package-lock.json ./
|
||||
|
||||
# installing dependencies
|
||||
# Copy workspace package files
|
||||
COPY ./web-app/package.json ./web-app/package-lock.json ./web-app/
|
||||
|
||||
# Install dependencies (workspaces)
|
||||
RUN npm i && npm cache clean --force
|
||||
|
||||
# copy all the soruce code
|
||||
COPY . .
|
||||
# Copy web-app source code
|
||||
COPY ./web-app ./web-app
|
||||
|
||||
# building app
|
||||
RUN npm run build
|
||||
# Build web-app workspace
|
||||
RUN npm run build --workspace=web-app
|
||||
|
||||
#-----------------------------------------
|
||||
# STAGE 3: Run the Next.js server
|
||||
@@ -34,14 +37,14 @@ WORKDIR /app
|
||||
# making sure the production server does not use mock auth
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=builder /app/public/* /app/public/
|
||||
COPY --from=builder /app/web-app/public/* /app/public/
|
||||
# this file is required for the pdfjs-dist package
|
||||
COPY --from=builder /app/node_modules/pdfjs-dist/build/pdf.worker.min.mjs /app/public/pdf.worker.min.mjs
|
||||
|
||||
# Automatically leverage output traces to reduce image size
|
||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||
COPY --from=builder --chown=nonroot:nonroot /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nonroot:nonroot /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=nonroot:nonroot /app/web-app/.next/standalone ./
|
||||
COPY --from=builder --chown=nonroot:nonroot /app/web-app/.next/static ./.next/static
|
||||
|
||||
USER nonroot
|
||||
|
||||
|
||||
Reference in New Issue
Block a user