FROM docker.io/ollama/ollama:0.9.6

ARG UID=1000
ARG GID=1000
RUN groupadd --system --gid ${GID} worker && \
    useradd --system --gid ${GID} --uid ${UID} --home /home/worker worker && \
    mkdir -p /home/worker && chown worker:worker /home/worker

WORKDIR /home/worker
USER worker
ENTRYPOINT ["/bin/ollama"]
CMD ["serve"]