Skip to content

Commit

Permalink
Merge pull request #57 from ninoseki/use-circus
Browse files Browse the repository at this point in the history
refactor: use circus [skip ci]
  • Loading branch information
ninoseki committed Sep 4, 2020
2 parents 3e21bef + 96dc165 commit 49a9818
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Expand Up @@ -23,8 +23,9 @@ COPY app /backend/app
COPY --from=build /frontend /backend/frontend

RUN pip3 install poetry && poetry config virtualenvs.create false && poetry install --no-dev
RUN pip3 install circus

COPY supervisord.conf /etc/supervisord.conf
COPY circus.ini /etc/circus.ini

# spamd envs
ENV SPAMD_MAX_CHILDREN=1 \
Expand All @@ -37,4 +38,4 @@ ENV SPAMASSASSIN_PORT=7833 \

EXPOSE $PORT

CMD ["supervisord", "-c", "/etc/supervisord.conf"]
CMD ["circusd", "/etc/circus.ini"]
15 changes: 15 additions & 0 deletions circus.ini
@@ -0,0 +1,15 @@
[circus]
statsd = True

[watcher:web]
working_dir = /backend
cmd = /usr/local/bin/uvicorn app:app --fd $(circus.sockets.web)
use_sockets = True
stderr_stream.class=StdoutStream

[socket:web]
host = 0.0.0.0
port = $(circus.env.PORT)

[watcher:spampd]
cmd = /usr/sbin/spamd start -x -m $(circus.env.SPAMD_MAX_CHILDREN) -A $(circus.env.SPAMD_RANGE) -p $(circus.env.SPAMD_PORT)
14 changes: 0 additions & 14 deletions supervisord.conf

This file was deleted.

0 comments on commit 49a9818

Please sign in to comment.