Dockerfile 1.6 KB

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