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.
 
 
 
 
 
 

72 rader
2.0 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:10.20.1-alpine3.11 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.7-slim-stretch as base
  21. RUN apt-get update \
  22. && apt-get -y install gcc default-libmysqlclient-dev
  23. RUN pip --no-cache-dir install --user mysqlclient cx-Oracle
  24. # Final image
  25. FROM python:3.7-slim-stretch
  26. WORKDIR pinry
  27. RUN mkdir /data && chown -R www-data:www-data /data
  28. RUN groupadd -g 2300 tmpgroup \
  29. && usermod -g tmpgroup www-data \
  30. && groupdel www-data \
  31. && groupadd -g 1000 www-data \
  32. && usermod -g www-data www-data \
  33. && usermod -u 1000 www-data \
  34. && groupdel tmpgroup
  35. # Install nginx
  36. RUN apt-get update \
  37. && apt-get -y install nginx pwgen\
  38. && rm -rf /var/lib/apt/lists/* \
  39. && apt-get autoclean
  40. # Install Pipfile requirements
  41. COPY Pipfile* ./
  42. RUN pip install rcssmin --install-option="--without-c-extensions" \
  43. && pip install pipenv \
  44. && pipenv install --three --system --clear
  45. # Copy from previous stages
  46. COPY --from=yarn-build pinry-spa/dist /pinry/pinry-spa/dist
  47. COPY --from=base /root/.local /root/.local
  48. ENV PATH=/root/.local/bin:$PATH
  49. COPY . .
  50. # Load in all of our config files.
  51. ADD docker/nginx/nginx.conf /etc/nginx/nginx.conf
  52. ADD docker/nginx/sites-enabled/default /etc/nginx/sites-enabled/default
  53. # 80 is for nginx web, /data contains static files and database /start runs it.
  54. EXPOSE 80
  55. VOLUME ["/data"]
  56. CMD ["/pinry/docker/scripts/start.sh"]