Skip to content

Commit

Permalink
Merge pull request #183 from john-dupuy/use-correct-user-ubi8
Browse files Browse the repository at this point in the history
Change the user when copying over the application
  • Loading branch information
rsnyman committed May 27, 2021
2 parents b765e77 + 94b0b57 commit 13774fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions backend/docker/Dockerfile.scheduler
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM registry.access.redhat.com/ubi8/python-38

# add application sources with correct perms for OCP
USER 0
COPY . /app
WORKDIR /app
RUN pip install --no-cache-dir -U pip && pip install --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ibutsu_server && chmod -R g+rwX ibutsu_server
RUN chown -R 1001:0 ./
USER 1001

# Install deps
RUN pip install --no-cache-dir -U pip setuptools wheel && pip install --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ibutsu_server && chmod -R g+rwX ibutsu_server
ENTRYPOINT ["celery"]

# Run application
CMD ["beat", "-A", "ibutsu_server.tasks.queues:app", "--loglevel=info", "--pidfile=ibutsu_server/celerybeat.pid", "--schedule=ibutsu_server/celerybeat-schedule"]
9 changes: 8 additions & 1 deletion backend/docker/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
FROM registry.access.redhat.com/ubi8/python-38

# add application sources with correct perms for OCP
USER 0
COPY . /app
WORKDIR /app
RUN pip install --no-cache-dir -U pip && pip install --no-cache-dir -r requirements.txt
RUN chown -R 1001:0 ./
USER 1001

# Install deps
RUN pip install --no-cache-dir -U pip setuptools wheel && pip install --no-cache-dir -r requirements.txt
ENTRYPOINT ["celery"]

# Run application
CMD ["worker", "-E", "-A", "ibutsu_server.tasks.queues:app", "--loglevel=info", "--concurrency", "1", "--hostname", "ibutsu-worker@%n"]

0 comments on commit 13774fe

Please sign in to comment.