File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ COPY ${BUILD_PACKAGES_PATH}/ /unstract/
5050
5151# Install external dependencies from pyproject.toml
5252RUN uv sync --group deploy --locked --no-install-project --no-dev && \
53+ .venv/bin/python3 -m ensurepip --upgrade && \
5354 uv run opentelemetry-bootstrap -a install
5455
5556# -----------------------------------------------
Original file line number Diff line number Diff line change @@ -49,8 +49,12 @@ COPY --chown=${APP_USER}:${APP_USER} ${BUILD_CONTEXT_PATH}/pyproject.toml ${BUIL
4949COPY --chown=${APP_USER}:${APP_USER} ${BUILD_PACKAGES_PATH}/core /unstract/core
5050COPY --chown=${APP_USER}:${APP_USER} ${BUILD_PACKAGES_PATH}/flags /unstract/flags
5151
52+ # Switch to non-root user
53+ USER ${APP_USER}
54+
5255# Install external dependencies from pyproject.toml
5356RUN uv sync --group deploy --locked --no-install-project --no-dev && \
57+ .venv/bin/python3 -m ensurepip --upgrade && \
5458 uv run opentelemetry-bootstrap -a install
5559
5660# -----------------------------------------------
@@ -61,12 +65,12 @@ FROM ext-dependencies AS production
6165# Copy application code (this layer changes most frequently)
6266COPY --chown=${APP_USER}:${APP_USER} ${BUILD_CONTEXT_PATH} ./
6367
68+ # Switch to non-root user
69+ USER ${APP_USER}
70+
6471# Install the application in non-editable mode to avoid permission issues
6572RUN uv sync --group deploy --locked
6673
67- # Switch to non-root user for the rest of the operations
68- USER ${APP_USER}
69-
7074EXPOSE 3001
7175
7276# During debugging, this entry point will be overridden
Original file line number Diff line number Diff line change @@ -51,8 +51,12 @@ COPY --chown=${APP_USER}:${APP_USER} ${BUILD_CONTEXT_PATH}/pyproject.toml ${BUIL
5151COPY --chown=${APP_USER}:${APP_USER} ${BUILD_PACKAGES_PATH}/core /unstract/core
5252COPY --chown=${APP_USER}:${APP_USER} ${BUILD_PACKAGES_PATH}/flags /unstract/flags
5353
54+ # Switch to non-root user
55+ USER ${APP_USER}
56+
5457# Install external dependencies from pyproject.toml
5558RUN uv sync --group deploy --locked --no-install-project --no-dev && \
59+ .venv/bin/python3 -m ensurepip --upgrade && \
5660 uv run opentelemetry-bootstrap -a install
5761
5862# -----------------------------------------------
@@ -63,6 +67,9 @@ FROM ext-dependencies AS production
6367# Copy application code (this layer changes most frequently)
6468COPY --chown=${APP_USER}:${APP_USER} ${BUILD_CONTEXT_PATH} ./
6569
70+ # Switch to non-root user
71+ USER ${APP_USER}
72+
6673# Install just the application in editable mode
6774RUN uv sync --group deploy --locked
6875
@@ -77,9 +84,6 @@ RUN for dir in "${TARGET_PLUGINS_PATH}"/*/; do \
7784 done && \
7885 mkdir -p prompt-studio-data
7986
80- # Switch to non-root user
81- USER ${APP_USER}
82-
8387EXPOSE 3003
8488
8589CMD ["./entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ COPY ${BUILD_PACKAGES_PATH}/flags /unstract/flags
4747
4848# Install external dependencies from pyproject.toml
4949RUN uv sync --group deploy --locked --no-install-project --no-dev && \
50+ .venv/bin/python3 -m ensurepip --upgrade && \
5051 uv run opentelemetry-bootstrap -a install
5152
5253# -----------------------------------------------
Original file line number Diff line number Diff line change @@ -48,8 +48,12 @@ COPY --chown=${APP_USER}:${APP_USER} ${BUILD_CONTEXT_PATH}/pyproject.toml ${BUIL
4848# Copy local package dependencies
4949COPY --chown=${APP_USER}:${APP_USER} ${BUILD_PACKAGES_PATH}/core /unstract/core
5050
51+ # Switch to non-root user
52+ USER ${APP_USER}
53+
5154# Install external dependencies from pyproject.toml
5255RUN uv sync --group deploy --locked --no-install-project --no-dev && \
56+ .venv/bin/python3 -m ensurepip --upgrade && \
5357 uv run opentelemetry-bootstrap -a install
5458
5559# -----------------------------------------------
@@ -60,14 +64,14 @@ FROM ext-dependencies AS production
6064# Copy application code (this layer changes most frequently)
6165COPY --chown=${APP_USER}:${APP_USER} ${BUILD_CONTEXT_PATH} ./
6266
67+ # Switch to non-root user
68+ USER ${APP_USER}
69+
6370# Install just the application
6471RUN uv sync --group deploy --locked && \
6572 chmod +x ./entrypoint.sh
6673
6774# # Make entrypoint executable
6875# RUN chmod +x ./entrypoint.sh
6976
70- # Switch to non-root user
71- USER ${APP_USER}
72-
7377CMD ["./entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -44,8 +44,12 @@ FROM base AS ext-dependencies
4444# Copy dependency-related files
4545COPY ${BUILD_CONTEXT_PATH}/pyproject.toml ${BUILD_CONTEXT_PATH}/uv.lock ${BUILD_CONTEXT_PATH}/README.md ./
4646
47+ # Switch to non-root user
48+ USER ${APP_USER}
49+
4750# Install external dependencies from pyproject.toml
4851RUN uv sync --group deploy --locked --no-install-project --no-dev && \
52+ .venv/bin/python3 -m ensurepip --upgrade && \
4953 uv run opentelemetry-bootstrap -a install
5054
5155# -----------------------------------------------
@@ -56,12 +60,12 @@ FROM ext-dependencies AS production
5660# Copy application code (this layer changes most frequently)
5761COPY --chown=${APP_USER}:${APP_USER} ${BUILD_CONTEXT_PATH} ./
5862
59- # Install just the application
60- RUN uv sync --group deploy --locked
61-
6263# Switch to non-root user
6364USER ${APP_USER}
6465
66+ # Install just the application
67+ RUN uv sync --group deploy --locked
68+
6569EXPOSE 3004
6670
6771# During debugging, this entry point will be overridden.
You can’t perform that action at this time.
0 commit comments