feat: migrate to Next.js for Mini App and enhance project structure
- Replaced the previous webapp with a new Mini App built using Next.js, improving performance and maintainability. - Updated the `.gitignore` to exclude Next.js build artifacts and node modules. - Revised documentation in `AGENTS.md`, `README.md`, and `architecture.md` to reflect the new Mini App structure and technology stack. - Enhanced Dockerfile to support the new build process for the Next.js application. - Updated CI workflow to build and test the Next.js application. - Added new configuration options for the Mini App, including `MINI_APP_SHORT_NAME` for improved deep linking. - Refactored frontend testing setup to accommodate the new structure and testing framework. - Removed legacy webapp files and dependencies to streamline the project.
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -1,14 +1,22 @@
|
||||
# Multi-stage: builder installs deps; runtime copies only site-packages and app code.
|
||||
# Multi-stage: webapp build (Next.js), Python builder, runtime.
|
||||
# Single image for both dev and prod; Compose files differentiate behavior.
|
||||
|
||||
# --- Stage 1: builder (dependencies only) ---
|
||||
# --- Stage 1: webapp build (Next.js static export) ---
|
||||
FROM node:20-slim AS webapp-builder
|
||||
WORKDIR /webapp
|
||||
COPY webapp-next/package.json webapp-next/package-lock.json* ./
|
||||
RUN npm ci
|
||||
COPY webapp-next/ ./
|
||||
RUN npm run build
|
||||
|
||||
# --- Stage 2: builder (Python dependencies only) ---
|
||||
FROM python:3.12-slim AS builder
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml ./
|
||||
COPY duty_teller/ ./duty_teller/
|
||||
RUN pip install --no-cache-dir .
|
||||
|
||||
# --- Stage 2: runtime (minimal final image) ---
|
||||
# --- Stage 3: runtime (minimal final image) ---
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
@@ -27,7 +35,7 @@ COPY main.py pyproject.toml entrypoint.sh ./
|
||||
RUN chmod +x entrypoint.sh
|
||||
COPY duty_teller/ ./duty_teller/
|
||||
COPY alembic/ ./alembic/
|
||||
COPY webapp/ ./webapp/
|
||||
COPY --from=webapp-builder /webapp/out ./webapp-next/out
|
||||
|
||||
# Create data dir; entrypoint runs as root, fixes perms for volume, then runs app as botuser
|
||||
RUN adduser --disabled-password --gecos "" botuser \
|
||||
|
||||
Reference in New Issue
Block a user