pinry / docker-pinry

An easy way to get a Pinry instance up and running using Docker.
http://getpinry.com/
Other
55 stars 23 forks source link

Internal server error #7

Closed snobear closed 6 years ago

snobear commented 7 years ago

Similar to #5, I'm getting an internal server error in my browser when launching pinry via docker, fresh install. docker logs show:

/usr/lib/python2.7/dist-packages/supervisor/options.py:295: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2017-01-17 18:45:06,904 CRIT Supervisor running as root (no user in config file)
2017-01-17 18:45:06,904 WARN Included extra file "/etc/supervisor/conf.d/uwsgi.conf" during parsing
2017-01-17 18:45:06,904 WARN Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
2017-01-17 18:45:06,922 INFO RPC interface 'supervisor' initialized
2017-01-17 18:45:06,922 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-01-17 18:45:06,922 INFO supervisord started with pid 9
2017-01-17 18:45:07,924 INFO spawned: 'nginx' with pid 12
2017-01-17 18:45:07,925 INFO spawned: 'uwsgi' with pid 13
2017-01-17 18:45:08,936 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-01-17 18:45:08,936 INFO success: uwsgi entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

All commands were run per the README. ,I'm not seeing much else when entering the container and looking at /var/log. Any ideas?

snobear commented 7 years ago

Two changes I made to get pinry up:

This fixed the ImportError: No module named wsgi error in /srv/www/pinry/logs/uwsgi.log.

    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings")

to

    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings.production")

in both /srv/www/pinry/manage.py and /srv/www/pinry/pinry/wsgi.py. Then restarted uwsgi in the container with: supervisorctl restart uwsgi. Also set SECRET_KEY to a random string in /srv/www/pinry/pinry/settings/production.py if its not already in there. Can't remember if I added that or not.

Just testing out pinry for now but if I end up using it longer term I'll see about a cleaner fix instead of hardcoding the environment like that and submit a PR.

jchanfnet commented 7 years ago

@snobear are these files accessed inside the container? I don't see them in docker-pinry files. I'm trying to get this running too.

snobear commented 7 years ago

Yes, I edited those files directly in the container.

I'm running an nginx proxy on top, so the app is started like so:

docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
docker run -e VIRTUAL_HOST="side-gig.com" -d=true -p=10000:80 -v=/mnt/pinry:/data pinry/pinry /start

Then you can enter the pinry container with

docker exec -it <pinrycontainerid> bash
overshard commented 6 years ago

This might be fixed now form @tsmsogn but I haven't tested it, if anyone wants to confirm that'd be awesome!