1
0

Dockerfile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM composer:1.7 as php-build
  2. RUN apk add git
  3. RUN adduser -S dev
  4. RUN mkdir /koel && chown dev /koel
  5. COPY --chown=dev:nogroup ./koel /koel
  6. WORKDIR /koel
  7. USER dev
  8. RUN composer install --no-interaction
  9. FROM node:8.12.0-alpine as js-build
  10. # gyp verb `which` failed Error: not found: python2
  11. # gyp verb `which` failed at getNotFoundError (/koel/node_modules/which/which.js:13:12)
  12. # ...
  13. # gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:154:21)
  14. RUN apk add python2 make g++
  15. RUN adduser -S dev
  16. USER dev
  17. COPY --from=php-build --chown=dev:nogroup /koel /koel
  18. WORKDIR /koel
  19. RUN yarn install
  20. FROM php:7.2.10-apache-stretch
  21. RUN find / -xdev -type f -perm /u+s -exec chmod --changes u-s {} \; \
  22. && find / -xdev -type f -perm /g+s -exec chmod --changes g-s {} \;
  23. # libpq-dev: required for build of pdo_pgsql (includes libpq-fe.h)
  24. # zlib1g-dev: required by zip module
  25. RUN apt-get update && apt-get install --yes \
  26. libpq-dev \
  27. zlib1g-dev \
  28. netcat
  29. RUN docker-php-ext-install -j$(nproc) \
  30. exif \
  31. pdo_pgsql \
  32. zip
  33. RUN a2enmod headers rewrite
  34. RUN a2disconf other-vhosts-access-log
  35. COPY ./apache2.conf /etc/apache2/apache2.conf
  36. RUN chmod o+r /etc/apache2/apache2.conf
  37. EXPOSE 8080
  38. # https://github.com/docker-library/docs/blob/master/php/README.md
  39. RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
  40. COPY --from=js-build --chown=root:www-data /koel /koel
  41. WORKDIR /koel
  42. RUN chown --changes --recursive www-data .env storage/
  43. COPY ./run-koel.sh /
  44. RUN chmod o+rx /run-koel.sh
  45. USER www-data
  46. CMD ["/run-koel.sh"]