Files
openccb/web/studio/Dockerfile
T
Nurfog 024bd6e46d feat: enhance asset import functionality and unit tracking
- Added WHISPER_URL environment variable to docker-compose for audio transcription service.
- Updated Nginx configuration to increase timeout settings for API requests.
- Enhanced asset ingestion process to extract unit numbers from ZIP entry paths, supporting various naming conventions.
- Implemented logic to split intensive courses into two regular courses during asset import.
- Added new fields to the Asset and QuestionBank models to track unit numbers and source asset links.
- Introduced backward-compatible fallbacks for fetching study plans and courses from legacy MySQL database.
- Improved error handling and progress tracking during ZIP file uploads in the frontend.
- Created a new SQL migration to add unit_number and source_asset_id columns to the assets and question_bank tables, along with necessary indexes for performance.
2026-04-07 13:38:22 -04:00

65 lines
1.8 KiB
Docker

# syntax=docker/dockerfile:1.7
# Build stage for Rust CMS
FROM rust:1-bookworm AS rust-builder
WORKDIR /usr/src/app
# Install system dependencies first
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
# Copy entire project for building (simpler and more reliable)
COPY Cargo.toml Cargo.lock ./
COPY shared/ ./shared/
COPY services/ ./services/
# Build the CMS service
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/tmp/cargo-target \
CARGO_TARGET_DIR=/tmp/cargo-target cargo build --release -p cms-service && \
cp /tmp/cargo-target/release/cms-service /usr/src/app/cms-service
# Build stage for Next.js Studio
FROM node:20-alpine AS node-builder
WORKDIR /app
COPY web/studio/package*.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY web/studio/ .
ARG NEXT_PUBLIC_CMS_API_URL
ARG NEXT_PUBLIC_LMS_API_URL
ENV NEXT_PUBLIC_CMS_API_URL=$NEXT_PUBLIC_CMS_API_URL
ENV NEXT_PUBLIC_LMS_API_URL=$NEXT_PUBLIC_LMS_API_URL
RUN --mount=type=cache,target=/root/.npm npm run build
# Final stage
FROM node:20-slim AS runner
WORKDIR /app
ENV NODE_ENV production
# Install system dependencies for Rust binary and asset processing
RUN apt-get update && apt-get install -y \
openssl \
ca-certificates \
ffmpeg \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Install sharp for Next.js image optimization
RUN --mount=type=cache,target=/root/.npm npm install sharp
# Copy CMS binary
COPY --from=rust-builder /usr/src/app/cms-service ./
# Copy Studio frontend
COPY --from=node-builder /app/public ./public
COPY --from=node-builder /app/.next/standalone ./
COPY --from=node-builder /app/.next/static ./.next/static
# Copy entrypoint
COPY web/studio/entrypoint.sh ./
RUN chmod +x entrypoint.sh
EXPOSE 3000 3001
CMD ["./entrypoint.sh"]