# Build context: autogpt_platform/scripted_model
# Standard library only, so the image builds in seconds with nothing to install.
# The image's openssl makes the TLS port's certificates (tls.py).
FROM python:3.13-slim

# /tls holds the TLS port's certificate authority, for the services that call
# it. A volume mounted there starts out owned by this user, so it can write it.
RUN useradd --system --no-create-home scripted-model \
    && mkdir /tls && chown scripted-model /tls
WORKDIR /app
COPY scripted_model ./scripted_model

USER scripted-model
ENV PYTHONUNBUFFERED=1 \
    SCRIPTED_MODEL_PORT=4010 \
    SCRIPTED_MODEL_SCRIPTS_DIR=/scripts

EXPOSE 4010
CMD ["python", "-m", "scripted_model"]
