FROM python:3.9 WORKDIR /code COPY . . RUN /usr/local/bin/python -m pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt RUN python -c "import pickle; \ import nbformat; \ with open('/code/webpanel_ntbk.ipynb', 'r') as f: \ notebook = nbformat.read(f, nbformat.NO_CONVERT); \ with open('/code/webpanel_ntbk.pkl', 'wb') as f: \ pickle.dump(webpanel_ntbk, f)" #RUN python generate_webpanel.py #RUN cat webpanel_ntbk.py #CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--access-logfile", "-", "--error-logfile", "-", "--timeout", "120", "webpanel_ntbk:app"] CMD ["panel", "serve", "webpanel_ntbk.pkl", "--port", "7860", "--address", "0.0.0.0", "--allow-websocket-origin", "*"]