1

I'm attempting to start a Perl Dancer app in a production environment.

I'm invoking uWSGI as follows:

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl

and while the app loads and runs, it is laden with errors because no environment gets set at all (not even the default development environment).

These do not appear to work:

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl --env production
uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl production

FYI, this works, using plackup & starman:

plackup -E production -s Starman --workers=10 -l /tmp/app.sock -a ./bin/app.pl

I have read through this: http://uwsgi-docs.readthedocs.org/en/latest/Options.html but there doesn't appear to be a Dancer-specific environment setting, such as there is for Python.

Thoughts? Thx in advance!

yahermann
  • 1,539
  • 1
  • 12
  • 33

1 Answers1

4

Ok, just answered my own question.

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl --env PLACK_ENV=production

Hope this is helpful to others.

yahermann
  • 1,539
  • 1
  • 12
  • 33
  • You made my day, I was looking for the exact thing for Mojolicious app from couple of days and finally landed here. Thanks – rai-gaurav Jul 26 '19 at 06:21