FROM python:3.12-slim ENV PYTHONUNBUFFERED=1 MPLCONFIGDIR=/tmp/matplotlib XDG_CACHE_HOME=/tmp \ OPENPELS_STATIC_DIR=/app/static \ OPENPELS_ENGINE=/app/simulator/library/ngspice/studies/xfly6s_xfly8s_c3l_scaled_comparison/gui/xfly_compare_gui.py \ OPENPELS_RUN_DIR=/tmp/openpels-runtime PORT=7860 RUN apt-get update && apt-get install -y --no-install-recommends ngspice \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements-simulator.txt ./ RUN pip install --no-cache-dir -r requirements-simulator.txt RUN useradd -m -u 1000 appuser COPY --chown=appuser static ./static COPY --chown=appuser simulator ./simulator COPY --chown=appuser sp2 ./sp2 COPY --chown=appuser server.py simulator_service.py simulator_frame.py simulator_bridge.js simulator-source.json ./ USER appuser EXPOSE 7860 CMD ["python3", "server.py", "--host", "0.0.0.0"]