Skip to content

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

Making docker user names consistent (#5238)

Tejas Warathec2d8d647f8d7
diff --git a/api/Dockerfile b/api/Dockerfile
index 2f7123d3e..0b0959361 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -89,16 +89,16 @@ RUN apt-get update \
RUN mkdir /static
# Create a non-root user, and make it the owner of the static dir created above
-RUN useradd --create-home opener \
- && chown -R opener /static
-USER opener
+RUN useradd --create-home ov_user \
+ && chown -R ov_user /static
+USER ov_user
# Copy subpackages from additional build-context 'packages'
# hadolint ignore=DL3022
-COPY --chown=opener --from=packages openverse-attribution /packages/python/openverse-attribution/
+COPY --chown=ov_user --from=packages openverse-attribution /packages/python/openverse-attribution/
# Copy code into the final image
-COPY --chown=opener . /api/
+COPY --chown=ov_user . /api/
# Collect static assets, these are used by the next stage, `nginx`
RUN env \
diff --git a/api/justfile b/api/justfile
index d724387bb..b9c97931f 100644
--- a/api/justfile
+++ b/api/justfile
@@ -98,7 +98,7 @@ recreate:
# Launch a `pgcli` shell in the web container
pgcli db_user_pass="deploy" db_name="openledger": up
- env DC_USER="opener" just ../_pgcli web {{ db_user_pass }} {{ db_name }} db
+ env DC_USER="ov_user" just ../_pgcli web {{ db_user_pass }} {{ db_name }} db
#########################
# Django administration #
@@ -112,7 +112,7 @@ dj-local *args:
# Run Django administrative commands inside the Docker container
[positional-arguments]
dj *args: wait-up
- env DC_USER="{{ env_var_or_default("DC_USER", "opener") }}" just ../exec web python manage.py "$@"
+ env DC_USER="{{ env_var_or_default("DC_USER", "ov_user") }}" just ../exec web python manage.py "$@"
# Get IPython shell inside the Docker container
ipython:
@@ -158,7 +158,7 @@ generate-docs doc="media-props" fail_on_diff="true":
# Run API tests inside the Docker container
[positional-arguments]
test *args: wait-up
- env DC_USER="opener" just ../exec web pytest "$@"
+ env DC_USER="ov_user" just ../exec web pytest "$@"
# Run API tests locally
[positional-arguments]
diff --git a/env.template b/env.template
index fa8dfa849..419481a48 100644
--- a/env.template
+++ b/env.template
@@ -1,3 +1,3 @@
-# DC_USER=opener
+# DC_USER=ov_user
# SKIP_DOTENV_FILES_RECREATION=true
diff --git a/indexer_worker/Dockerfile b/indexer_worker/Dockerfile
index 9210ac1f0..879cd1fc8 100644
--- a/indexer_worker/Dockerfile
+++ b/indexer_worker/Dockerfile
@@ -73,13 +73,13 @@ RUN apt-get update \
&& mkdir /worker_state
# Create a non-root user
-RUN useradd ingestionu \
- && chown ingestionu /worker_state
+RUN useradd ov_user \
+ && chown ov_user /worker_state
-USER ingestionu
+USER ov_user
# Copy code into the final image
-COPY --chown=ingestionu . /indexer_worker/
+COPY --chown=ov_user . /indexer_worker/
# Expose Gunicorn server to indexer worker Falcon app
EXPOSE 8003
diff --git a/ingestion_server/Dockerfile b/ingestion_server/Dockerfile
index e28c3366f..2d4630954 100644
--- a/ingestion_server/Dockerfile
+++ b/ingestion_server/Dockerfile
@@ -72,13 +72,13 @@ RUN apt-get update \
&& mkdir /worker_state
# Create a non-root user
-RUN useradd ingestionu \
- && chown ingestionu /worker_state
+RUN useradd ov_user \
+ && chown ov_user /worker_state
-USER ingestionu
+USER ov_user
# Copy code into the final image
-COPY --chown=ingestionu . /ingestion_server/
+COPY --chown=ov_user . /ingestion_server/
# Exposes
# - 8001: Gunicorn server for `ingestion_server` Falcon app
diff --git a/justfile b/justfile
index 4676d7bbe..6cc9bf999 100644
--- a/justfile
+++ b/justfile
@@ -5,7 +5,7 @@ set dotenv-load := true
# _ - Private recipes (https://github.com/casey/just#private-recipes)
IS_CI := env_var_or_default("CI", "")
-DC_USER := env_var_or_default("DC_USER", "opener")
+DC_USER := env_var_or_default("DC_USER", "ov_user")
# Show all available recipes, also recurses inside nested justfiles
@_default: