Skip to content

Commit

Permalink
Dockerfile: run with uwsgi rather than plackup
Browse files Browse the repository at this point in the history
Convert to using uwsgi by default. The command given is meant for use in
a production environment. A development setup with be provided
separately.
  • Loading branch information
haarg committed Apr 27, 2024
1 parent 37dfa58 commit 9dac108
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN \
apt update
apt install -y -f --no-install-recommends nodejs
npm install -g npm
apt install -y -f libcmark-dev dumb-init
apt install -y -f libcmark-dev
EOT

WORKDIR /metacpan-web/
Expand All @@ -39,9 +39,14 @@ RUN mkdir var && chown metacpan:users var

USER metacpan

EXPOSE 5001

# Runs "/usr/bin/dumb-init -- /my/script --with --args"
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

CMD ["plackup", "-p", "5001", "-r"]
CMD [ \
"/usr/bin/uwsgi", \
"--plugins", "psgi", \
"--uwsgi-socket", ":3031", \
"--http-socket", ":80", \
"--http-socket-modifier1", "5", \
"--ini", "/metacpan-web/servers/uwsgi.ini", \
"--psgi", "app.psgi" \
]

EXPOSE 80 3031
6 changes: 6 additions & 0 deletions servers/uwsgi.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[uwsgi]
master = true
workers = 20
early-psgi = true
perl-no-die-catch = true
disable-logging = true

0 comments on commit 9dac108

Please sign in to comment.