Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

80 lignes
2.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, Jason Kaltsikis
  9. # Updated: May 2nd, 2020
  10. # Require: Docker (http://www.docker.io/)
  11. # -----------------------------------------------------------------------------
  12. # Build static yarn file
  13. FROM node:14-buster as yarn-build
  14. WORKDIR pinry-spa
  15. COPY pinry-spa/package.json pinry-spa/yarn.lock ./
  16. RUN yarn install
  17. COPY pinry-spa .
  18. RUN yarn build
  19. # Required for other database options
  20. FROM python:3.9.12-slim-buster as base
  21. ARG DEBIAN_FRONTEND=noninteractive
  22. RUN apt-get update \
  23. && if [ $(dpkg --print-architecture) = "arm64" -o $(dpkg --print-architecture) = "armhf" ]; then apt-get -y install apt-utils; fi \
  24. && apt-get -y install gcc default-libmysqlclient-dev
  25. RUN pip --no-cache-dir install --user mysqlclient cx-Oracle
  26. # Final image
  27. FROM python:3.9.12-slim-buster
  28. ARG DEBIAN_FRONTEND=noninteractive
  29. WORKDIR pinry
  30. RUN mkdir /data && chown -R www-data:www-data /data
  31. RUN groupadd -g 2300 tmpgroup \
  32. && usermod -g tmpgroup www-data \
  33. && groupdel www-data \
  34. && groupadd -g 1000 www-data \
  35. && usermod -g www-data www-data \
  36. && usermod -u 1000 www-data \
  37. && groupdel tmpgroup
  38. RUN apt-get update \
  39. # Install nginx
  40. && apt-get -y install nginx pwgen \
  41. # Install Pillow dependencies
  42. && apt-get -y install libopenjp2-7 libjpeg-turbo-progs libjpeg62-turbo-dev libtiff5-dev libxcb1 \
  43. # Needed to compile psycopg2 on arm (fallback for psycopg2-binary)
  44. && if [ $(dpkg --print-architecture) = "arm64" -o $(dpkg --print-architecture) = "armhf" ]; then apt-get -y install apt-utils libpq-dev gcc; fi \
  45. && rm -rf /var/lib/apt/lists/* \
  46. && apt-get autoclean
  47. # Install Pipfile requirements
  48. COPY Pipfile* ./
  49. RUN pip install "rcssmin==1.0.6" --install-option="--without-c-extensions" \
  50. && pip install pipenv \
  51. && pipenv install --three --system --clear
  52. # Copy from previous stages
  53. COPY --from=yarn-build pinry-spa/dist /pinry/pinry-spa/dist
  54. COPY --from=base /root/.local /root/.local
  55. ENV PATH=/root/.local/bin:$PATH
  56. COPY . .
  57. # Load in all of our config files.
  58. ADD docker/nginx/nginx.conf /etc/nginx/nginx.conf
  59. ADD docker/nginx/sites-enabled/default /etc/nginx/sites-enabled/default
  60. # 80 is for nginx web, /data contains static files and database /start runs it.
  61. EXPOSE 80
  62. ENV DJANGO_SETTINGS_MODULE pinry.settings.docker
  63. VOLUME ["/data"]
  64. CMD ["/pinry/docker/scripts/start.sh"]