# sessions-web: the prod half of the session manager.
# Build:  podman build -t localhost/sessions-web:latest web/
FROM docker.io/library/python:3.13-slim

RUN apt-get update \
 && apt-get install -y --no-install-recommends openssh-client \
 && rm -rf /var/lib/apt/lists/* \
 && useradd --uid 10001 --create-home --home-dir /home/app app

WORKDIR /app
COPY app.py /app/app.py
# Mount points must already exist: the container runs with a read-only root.
RUN touch /app/ssh_key /app/known_hosts

USER 10001
ENV PYTHONUNBUFFERED=1 SESSIONS_LISTEN=0.0.0.0:8470
EXPOSE 8470
CMD ["python3", "/app/app.py"]
