docker-entrypoint.sh 674 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. main() {
  3. nginx
  4. do_chown
  5. cd /srv/mediagoblin.example.org/mediagoblin/
  6. do_update
  7. if [ ! -f /var/lib/mediagoblin/date_configured ]
  8. then
  9. do_config
  10. fi
  11. startup
  12. }
  13. startup() {
  14. sudo -u mediagoblin ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543
  15. }
  16. do_update() {
  17. sudo -u mediagoblin bin/gmg dbupdate
  18. }
  19. do_config() {
  20. sudo -u mediagoblin bin/gmg adduser --username $GOBLIN_USER --password $GOBLIN_PASSWORD --email $GOBLIN_EMAIL
  21. sudo -u mediagoblin bin/gmg makeadmin $GOBLIN_USER
  22. date -I > /var/lib/mediagoblin/date_configured
  23. }
  24. do_chown() {
  25. chown -hR mediagoblin:www-data /var/lib/mediagoblin
  26. }
  27. main "$@"