- Add Frontend Dockerfile with Next.js standalone build - Add docker-compose.yml for production deployment - Add docker-compose.dev.yml for development with hot-reload - Configure Frontend next.config.js with standalone output - Add .dockerignore files for both backend and frontend - Add comprehensive README-DOCKER.md documentation - Update .gitignore to exclude node_modules and build artifacts - Remove obsolete component files (CycleCalculator.tsx, PHDiagram.tsx) - Backend and Frontend communicate via Docker network - Healthchecks configured for both services - Environment variables configured for API URL
44 lines
1.1 KiB
Docker
44 lines
1.1 KiB
Docker
FROM python:3.12-slim
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
WORKDIR /app
|
|
|
|
# Install system deps required by numpy/pandas/matplotlib and building wheels
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
gcc \
|
|
gfortran \
|
|
libatlas3-base \
|
|
libopenblas-dev \
|
|
liblapack-dev \
|
|
libfreetype6-dev \
|
|
libpng-dev \
|
|
pkg-config \
|
|
ca-certificates \
|
|
curl \
|
|
git \
|
|
libglib2.0-0 \
|
|
libxrender1 \
|
|
libxext6 \
|
|
libsm6 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy only requirements first for better layer caching
|
|
COPY requirements.txt /app/requirements.txt
|
|
|
|
# Upgrade pip and install python deps
|
|
RUN python -m pip install --upgrade pip setuptools wheel && \
|
|
python -m pip install -r /app/requirements.txt
|
|
|
|
# Copy project
|
|
COPY . /app
|
|
|
|
# Ensure Python and dynamic linker will find the native libs if mounted
|
|
ENV PYTHONPATH="/app:/app/IPM_SO:/app/IPM_DLL"
|
|
ENV LD_LIBRARY_PATH="/app/IPM_SO:/app/IPM_DLL"
|
|
|
|
EXPOSE 8001
|
|
|
|
# Default command runs uvicorn (use docker-compose override for development)
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"]
|