@@ -33,7 +33,7 @@ FROM python:3.12-slim as runtime
3333WORKDIR /app
3434
3535ENV RUN_AS_DEVIN=true
36- ENV SANDBOX_USER_ID =1000
36+ ENV OPENDEVIN_USER_ID =1000
3737ENV USE_HOST_NETWORK=false
3838ENV SSH_HOSTNAME=host.docker.internal
3939ENV WORKSPACE_BASE=/opt/workspace_base
@@ -43,29 +43,33 @@ RUN mkdir -p $WORKSPACE_BASE
4343RUN apt-get update -y \
4444 && apt-get install -y curl ssh sudo
4545
46- RUN useradd -l -m -u $SANDBOX_USER_ID -s /bin/bash opendevin && \
46+ RUN sed -i 's/^UID_MIN.*/UID_MIN 499/' /etc/login.defs # Default is 1000, but OSX is often 501
47+
48+ RUN groupadd app
49+ RUN useradd -l -m -u $OPENDEVIN_USER_ID -s /bin/bash opendevin && \
50+ usermod -aG app opendevin && \
4751 usermod -aG sudo opendevin && \
4852 echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
49- RUN chown -R opendevin:opendevin /app
53+ RUN chown -R opendevin:app /app && chmod -R 770 /app
5054USER opendevin
5155
5256ENV VIRTUAL_ENV=/app/.venv \
5357 PATH="/app/.venv/bin:$PATH" \
5458 PYTHONPATH='/app'
5559
56- COPY --chown=opendevin --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
57- USER root
58- RUN chown -R opendevin:opendevin ${VIRTUAL_ENV}
59- USER opendevin
60+ COPY --chown=opendevin:app --chmod=770 --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
61+ RUN playwright install --with-deps chromium
62+
63+ COPY --chown=opendevin:app --chmod=770 ./opendevin ./opendevin
64+ COPY --chown=opendevin:app --chmod=777 ./opendevin/runtime/plugins ./opendevin/runtime/plugins
65+ COPY --chown=opendevin:app --chmod=770 ./agenthub ./agenthub
6066
61- COPY --chown=opendevin ./opendevin ./opendevin
62- COPY --chown=opendevin ./agenthub ./agenthub
6367RUN python opendevin/core/download.py # No-op to download assets
64- RUN playwright install --with-deps chromium
68+ RUN chown -R opendevin:app /app/logs && chmod -R 770 /app/logs # This gets created by the download.py script
6569
66- COPY --chown=opendevin --from=frontend-builder /app/dist ./frontend/dist
6770
68- COPY --chown=opendevin ./containers/app/entrypoint.sh /app/entrypoint.sh
71+ COPY --chown=opendevin:app --chmod=770 --from=frontend-builder /app/dist ./frontend/dist
72+ COPY --chown=opendevin:app --chmod=770 ./containers/app/entrypoint.sh /app/entrypoint.sh
6973
7074USER root
7175CMD ["/app/entrypoint.sh" ]
0 commit comments