Skip to content

Commit

Permalink
build: avoid root user in celery worker and beat
Browse files Browse the repository at this point in the history
  • Loading branch information
okradze committed Nov 1, 2023
1 parent ce4ad7f commit 0141b09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
3 changes: 3 additions & 0 deletions apps/worker/docker/Dockerfile.beat
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ RUN pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

RUN adduser --disabled-password --gecos '' myuser
USER myuser

# Copy project
COPY ./ /app/

Expand Down
25 changes: 3 additions & 22 deletions apps/worker/docker/Dockerfile.worker
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,11 @@ RUN pip install poetry \
&& poetry install --no-interaction --no-ansi


RUN adduser --disabled-password --gecos '' myuser
USER myuser

# Copy project
COPY ./ /app/

# Run Celery worker
ENTRYPOINT ["celery", "-A", "main", "worker", "--loglevel=info"]





# # Install Flower
# RUN pip install flower

# # Find where flower is installed and add it to the PATH
# ENV PATH=$PATH:$(dirname $(which flower))

# # Install supervisord
# RUN apt-get update && apt-get install -y supervisor

# # Copy project
# COPY ./ /app/

# # Copy supervisor configuration
# COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# # Run supervisord
# CMD ["/usr/bin/supervisord"]

0 comments on commit 0141b09

Please sign in to comment.