slw-cert-tool / Dockerfile
sunlitbytes's picture
deploy_notebook.py
fba11a9 verified
Raw History Blame Contribute Delete
748 Bytes
# Generated by deploy_notebook.py — edit freely.
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
MARIMO_SKIP_UPDATE_CHECK=1 \
PORT=7860
# Run as a non-root user (required by Hugging Face Spaces, good practice everywhere).
RUN useradd -m -u 1000 app
WORKDIR /home/app/work
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=app:app . .
USER app
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \
CMD python -c "import urllib.request,os;urllib.request.urlopen('http://127.0.0.1:'+os.environ.get('PORT','7860')+'/health').read()" || exit 1
CMD ["sh", "-c", "marimo run untitled_notebook.py --host 0.0.0.0 --port ${PORT:-7860} --headless --no-token"]