Skip to content

Commit c2d8d64

Browse files
Making docker user names consistent (#5238)
Co-authored-by: Dhruv Bhanushali <dhruv_b@live.com>
1 parent 7d0fc83 commit c2d8d64

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

api/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ RUN apt-get update \
8989
RUN mkdir /static
9090

9191
# Create a non-root user, and make it the owner of the static dir created above
92-
RUN useradd --create-home opener \
93-
&& chown -R opener /static
94-
USER opener
92+
RUN useradd --create-home ov_user \
93+
&& chown -R ov_user /static
94+
USER ov_user
9595

9696
# Copy subpackages from additional build-context 'packages'
9797
# hadolint ignore=DL3022
98-
COPY --chown=opener --from=packages openverse-attribution /packages/python/openverse-attribution/
98+
COPY --chown=ov_user --from=packages openverse-attribution /packages/python/openverse-attribution/
9999

100100
# Copy code into the final image
101-
COPY --chown=opener . /api/
101+
COPY --chown=ov_user . /api/
102102

103103
# Collect static assets, these are used by the next stage, `nginx`
104104
RUN env \

api/justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ recreate:
9898

9999
# Launch a `pgcli` shell in the web container
100100
pgcli db_user_pass="deploy" db_name="openledger": up
101-
env DC_USER="opener" just ../_pgcli web {{ db_user_pass }} {{ db_name }} db
101+
env DC_USER="ov_user" just ../_pgcli web {{ db_user_pass }} {{ db_name }} db
102102

103103
#########################
104104
# Django administration #
@@ -112,7 +112,7 @@ dj-local *args:
112112
# Run Django administrative commands inside the Docker container
113113
[positional-arguments]
114114
dj *args: wait-up
115-
env DC_USER="{{ env_var_or_default("DC_USER", "opener") }}" just ../exec web python manage.py "$@"
115+
env DC_USER="{{ env_var_or_default("DC_USER", "ov_user") }}" just ../exec web python manage.py "$@"
116116

117117
# Get IPython shell inside the Docker container
118118
ipython:
@@ -158,7 +158,7 @@ generate-docs doc="media-props" fail_on_diff="true":
158158
# Run API tests inside the Docker container
159159
[positional-arguments]
160160
test *args: wait-up
161-
env DC_USER="opener" just ../exec web pytest "$@"
161+
env DC_USER="ov_user" just ../exec web pytest "$@"
162162

163163
# Run API tests locally
164164
[positional-arguments]

env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# DC_USER=opener
1+
# DC_USER=ov_user
22

33
# SKIP_DOTENV_FILES_RECREATION=true

indexer_worker/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ RUN apt-get update \
7373
&& mkdir /worker_state
7474

7575
# Create a non-root user
76-
RUN useradd ingestionu \
77-
&& chown ingestionu /worker_state
76+
RUN useradd ov_user \
77+
&& chown ov_user /worker_state
7878

79-
USER ingestionu
79+
USER ov_user
8080

8181
# Copy code into the final image
82-
COPY --chown=ingestionu . /indexer_worker/
82+
COPY --chown=ov_user . /indexer_worker/
8383

8484
# Expose Gunicorn server to indexer worker Falcon app
8585
EXPOSE 8003

ingestion_server/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ RUN apt-get update \
7272
&& mkdir /worker_state
7373

7474
# Create a non-root user
75-
RUN useradd ingestionu \
76-
&& chown ingestionu /worker_state
75+
RUN useradd ov_user \
76+
&& chown ov_user /worker_state
7777

78-
USER ingestionu
78+
USER ov_user
7979

8080
# Copy code into the final image
81-
COPY --chown=ingestionu . /ingestion_server/
81+
COPY --chown=ov_user . /ingestion_server/
8282

8383
# Exposes
8484
# - 8001: Gunicorn server for `ingestion_server` Falcon app

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set dotenv-load := true
55
# _ - Private recipes (https://github.com/casey/just#private-recipes)
66

77
IS_CI := env_var_or_default("CI", "")
8-
DC_USER := env_var_or_default("DC_USER", "opener")
8+
DC_USER := env_var_or_default("DC_USER", "ov_user")
99

1010
# Show all available recipes, also recurses inside nested justfiles
1111
@_default:

0 commit comments

Comments
 (0)