Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

59 rader
1.6 KiB

  1. # -----------------------------------------------------------------------------
  2. # docker-pinry
  3. #
  4. # Builds a basic docker image that can run Pinry (http://getpinry.com) and serve
  5. # all of it's assets, there are more optimal ways to do this but this is the
  6. # most friendly and has everything contained in a single instance.
  7. #
  8. # Authors: Isaac Bythewood
  9. # Updated: Mar 29th, 2016
  10. # Require: Docker (http://www.docker.io/)
  11. # -----------------------------------------------------------------------------
  12. # Base system is the LTS version of Ubuntu.
  13. FROM python:3.6-stretch
  14. RUN groupadd -g 2300 tmpgroup \
  15. && usermod -g tmpgroup www-data \
  16. && groupdel www-data \
  17. && groupadd -g 1000 www-data \
  18. && usermod -g www-data www-data \
  19. && usermod -u 1000 www-data \
  20. && groupdel tmpgroup \
  21. #
  22. && mkdir -p /srv/www/pinry/logs \
  23. #
  24. && mkdir /data \
  25. && chown -R www-data:www-data /data \
  26. #
  27. && mkdir -p /var/log/gunicorn \
  28. && apt-get update \
  29. && apt-get -y install nginx nginx-extras pwgen \
  30. && rm -rf /var/lib/apt/lists/*
  31. RUN pip --no-cache-dir install pipenv gunicorn mysqlclient psycopg2 cx-Oracle
  32. COPY Pipfile* /srv/www/pinry/
  33. RUN cd /srv/www/pinry \
  34. && pipenv install --three --system --clear
  35. COPY . /srv/www/pinry/
  36. # Fix permissions
  37. RUN chown -R www-data:www-data /srv/www \
  38. && cd /srv/www/pinry \
  39. && python manage.py collectstatic --noinput
  40. # Load in all of our config files.
  41. ADD docker/nginx/nginx.conf /etc/nginx/nginx.conf
  42. ADD docker/nginx/sites-enabled/default /etc/nginx/sites-enabled/default
  43. ADD docker/scripts/* /scripts/
  44. # 80 is for nginx web, /data contains static files and database /start runs it.
  45. EXPOSE 80
  46. VOLUME ["/data"]
  47. CMD ["/scripts/start.sh"]