FROM composer:1.7 as php-build RUN apk add git RUN adduser -S dev RUN mkdir /koel && chown dev /koel COPY --chown=dev:nogroup ./koel /koel WORKDIR /koel USER dev RUN composer install --no-interaction FROM node:8.12.0-alpine as js-build # gyp verb `which` failed Error: not found: python2 # gyp verb `which` failed at getNotFoundError (/koel/node_modules/which/which.js:13:12) # ... # gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:154:21) RUN apk add python2 make g++ RUN adduser -S dev USER dev COPY --from=php-build --chown=dev:nogroup /koel /koel WORKDIR /koel RUN yarn install FROM php:7.2.10-apache-stretch RUN find / -xdev -type f -perm /u+s -exec chmod --changes u-s {} \; \ && find / -xdev -type f -perm /g+s -exec chmod --changes g-s {} \; # libpq-dev: required for build of pdo_pgsql (includes libpq-fe.h) # zlib1g-dev: required by zip module RUN apt-get update && apt-get install --yes \ libpq-dev \ zlib1g-dev \ netcat RUN docker-php-ext-install -j$(nproc) \ exif \ pdo_pgsql \ zip RUN a2enmod headers rewrite RUN a2disconf other-vhosts-access-log COPY ./apache2.conf /etc/apache2/apache2.conf RUN chmod o+r /etc/apache2/apache2.conf EXPOSE 8080 # https://github.com/docker-library/docs/blob/master/php/README.md RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini COPY --from=js-build --chown=root:www-data /koel /koel WORKDIR /koel RUN chown --changes --recursive www-data .env storage/ COPY ./run-koel.sh / RUN chmod o+rx /run-koel.sh USER www-data CMD ["/run-koel.sh"]