refactor: move Docker build files to web-app directory
Moved Dockerfile, build.sh, and .dockerignore to web-app/ for better project encapsulation. Each project now contains its own build configuration. ## Changes - Moved Dockerfile to web-app/ and simplified paths - Moved build.sh to web-app/ - Moved .dockerignore to web-app/ - Updated Dockerfile to work from web-app/ context (no workspace references) - Updated documentation for new build workflow ## Build Workflow - Build: Run from web-app/ directory (`cd web-app && ./build.sh 2.20.0`) - Deploy: Run from repository root (`./deploy-standalone.sh 2.20.0`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,9 +30,12 @@ All commands should be run from within the respective project directory.
|
|||||||
|
|
||||||
## Deployment Commands
|
## Deployment Commands
|
||||||
|
|
||||||
- `./build.sh` - Build Docker image for deployment
|
**Building Docker Image** (from web-app directory):
|
||||||
- `./deploy.sh` - Deploy Docker service to production
|
- `cd web-app && ./build.sh <version>` - Build Docker image
|
||||||
- `./debug-deploy.sh` - Deploy with debug configuration
|
|
||||||
|
**Deploying** (from repository root):
|
||||||
|
- `./deploy-standalone.sh <version>` - Deploy with docker-compose (standalone)
|
||||||
|
- `./deploy-swarm.sh <version>` - Deploy with Docker Swarm
|
||||||
|
|
||||||
## Architecture Overview
|
## Architecture Overview
|
||||||
|
|
||||||
|
|||||||
27
README.md
27
README.md
@@ -112,21 +112,30 @@ All backups are stored in `./mongo-backup/`:
|
|||||||
This directory is excluded from git via `.gitignore`.
|
This directory is excluded from git via `.gitignore`.
|
||||||
|
|
||||||
# Deploying
|
# Deploying
|
||||||
The deployment is done via Docker:
|
|
||||||
* build docker image
|
|
||||||
* deploy Docker service
|
|
||||||
|
|
||||||
## Building Docker image
|
The deployment is done via Docker.
|
||||||
Run the following command:
|
|
||||||
|
## Building Docker Image
|
||||||
|
|
||||||
|
From the `web-app/` directory:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
build.sh
|
cd web-app
|
||||||
|
./build.sh 2.20.0
|
||||||
```
|
```
|
||||||
|
|
||||||
The image will be stored in the local Docker instance.
|
The image will be stored in the local Docker instance.
|
||||||
|
|
||||||
## Deploying Docker service
|
## Deploying Docker Service
|
||||||
Run the following command:
|
|
||||||
|
From the repository root:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
deploy.sh
|
# Standalone deployment
|
||||||
|
./deploy-standalone.sh 2.20.0
|
||||||
|
|
||||||
|
# Or Swarm deployment
|
||||||
|
./deploy-swarm.sh 2.20.0
|
||||||
```
|
```
|
||||||
|
|
||||||
# Implementation details
|
# Implementation details
|
||||||
|
|||||||
@@ -12,20 +12,17 @@ RUN apk add --no-cache libc6-compat
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy monorepo root package files
|
# Copy package files
|
||||||
COPY ./package.json ./package-lock.json ./
|
COPY ./package.json ./package-lock.json ./
|
||||||
|
|
||||||
# Copy workspace package files
|
# Install dependencies
|
||||||
COPY ./web-app/package.json ./web-app/package-lock.json ./web-app/
|
|
||||||
|
|
||||||
# Install dependencies (workspaces)
|
|
||||||
RUN npm i && npm cache clean --force
|
RUN npm i && npm cache clean --force
|
||||||
|
|
||||||
# Copy web-app source code
|
# Copy application source code
|
||||||
COPY ./web-app ./web-app
|
COPY . .
|
||||||
|
|
||||||
# Build web-app workspace
|
# Build application
|
||||||
RUN npm run build --workspace=web-app
|
RUN npm run build
|
||||||
|
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
# STAGE 3: Run the Next.js server
|
# STAGE 3: Run the Next.js server
|
||||||
@@ -37,14 +34,14 @@ WORKDIR /app
|
|||||||
# making sure the production server does not use mock auth
|
# making sure the production server does not use mock auth
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
COPY --from=builder /app/web-app/public/* /app/public/
|
COPY --from=builder /app/public/* /app/public/
|
||||||
# this file is required for the pdfjs-dist package
|
# 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
|
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
|
# Automatically leverage output traces to reduce image size
|
||||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||||
COPY --from=builder --chown=nonroot:nonroot /app/web-app/.next/standalone ./
|
COPY --from=builder --chown=nonroot:nonroot /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nonroot:nonroot /app/web-app/.next/static ./.next/static
|
COPY --from=builder --chown=nonroot:nonroot /app/.next/static ./.next/static
|
||||||
|
|
||||||
USER nonroot
|
USER nonroot
|
||||||
|
|
||||||
Reference in New Issue
Block a user