Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Pass user to ingestion-server and indexer_worker containers (#897)

Krystle Salazar5c27de9ea980
diff --git a/ingestion_server/Dockerfile b/ingestion_server/Dockerfile
index 61849be5e..aaaeb0d71 100644
--- a/ingestion_server/Dockerfile
+++ b/ingestion_server/Dockerfile
@@ -48,10 +48,15 @@ COPY --from=builder /venv /venv
RUN apt-get update \
&& apt-get install -y curl libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
- && mkdir /worker_state
+ && mkdir /worker_state
+
+# Create a non-root user
+RUN useradd ingestionu
+RUN chown ingestionu /worker_state
+USER ingestionu
# Copy code into the final image
-COPY . /ingestion_server/
+COPY --chown=ingestionu . /ingestion_server/
# Exposes
# - 8001: Gunicorn server for `ingestion_server` Falcon app
diff --git a/load_sample_data.sh b/load_sample_data.sh
index 9450a6f8b..fe1c3fb47 100755
--- a/load_sample_data.sh
+++ b/load_sample_data.sh
@@ -108,7 +108,7 @@ just wait-for-index "audio-init"
just promote "audio" "init" "audio"
just wait-for-index "audio"
-# Image ingestion is flaky; but usally works on the next attempt
+# Image ingestion is flaky; but usually works on the next attempt
set +e
while true; do
just ingest-upstream "image" "init"