Pony.fm/Dockerfile

84 lines
2.2 KiB
Docker
Raw Normal View History

2021-03-27 04:58:08 +01:00
FROM jrottenberg/ffmpeg:4.3-alpine312 as ffmpeg
FROM alpine:3.12 as atomicparsley_builder
RUN apk add --no-cache make cmake linux-headers g++ git
RUN git clone https://github.com/wez/atomicparsley.git /tmp/atomicparsley
RUN cd /tmp/atomicparsley \
&& cmake . \
&& cmake --build . --config Release
2021-03-27 04:58:08 +01:00
FROM node:12-alpine as assets_builder
# To handle 'not get uid/gid'
RUN npm config set unsafe-perm true
RUN npm install -g gulp
WORKDIR /app
COPY package.json /app
RUN npm install
COPY gulpfile.js /app
COPY webpack.base.config.js /app
COPY webpack.dev.config.js /app
COPY webpack.production.config.js /app
2021-03-29 01:39:41 +02:00
COPY public /app/public/
COPY resources /app/resources/
2021-03-27 04:58:08 +01:00
RUN gulp build
FROM php:8.0-fpm-alpine
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
COPY --from=ffmpeg /usr/local /usr/local
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/install-php-extensions
COPY --from=atomicparsley_builder /tmp/atomicparsley/AtomicParsley /usr/local/bin/AtomicParsley
2021-03-27 04:58:08 +01:00
2021-03-30 23:08:15 +02:00
RUN apk update
## Common libraries required for ffmpeg & atomicparsley` to work
2021-03-30 23:08:15 +02:00
RUN apk add libgcc libstdc++ ca-certificates libcrypto1.1 libssl1.1 libgomp expat git
RUN apk add nginx sudo
2021-03-27 04:58:08 +01:00
# Install php extensions
2021-03-29 01:54:55 +02:00
RUN install-php-extensions mysqli pgsql pdo_mysql pdo_pgsql gmp gmagick redis
2021-03-27 04:58:08 +01:00
2021-03-30 23:08:15 +02:00
# not sure why but this needs to be after the php extensions otherwise some kind of dependency issue occurs
RUN apk add imagemagick
2021-03-27 04:58:08 +01:00
RUN mkdir /app && chown -R www-data: /app
USER www-data
WORKDIR /app
COPY --chown=www-data composer.json /app
COPY --chown=www-data composer.lock /app
RUN composer install --no-scripts --no-autoloader --ignore-platform-reqs
COPY --chown=www-data --from=assets_builder /app /app
COPY --chown=www-data . /app
RUN composer dump-autoload -o
RUN php artisan optimize
USER root
# Remove files no longer needed on the host
RUN rm /usr/bin/composer /usr/bin/install-php-extensions
COPY docker/nginx/site.conf /etc/nginx/conf.d/default.conf
2021-03-29 02:39:16 +02:00
COPY docker/php/php.ini /usr/local/etc/php/conf.d/php.ini
COPY docker/php/php.ini /usr/local/etc/php-fpm.d/php.ini
2021-03-27 04:58:08 +01:00
EXPOSE 80
ENTRYPOINT ["docker/entrypoint.sh"]