diff --git a/.drone.yml b/.drone.yml index 99c0765..73e2aeb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,12 +4,12 @@ name: default steps: - name: backend - image: composer:2.1.14 + image: composer:2.1.14-alpine commands: - cd backend && composer install - name: frontend - image: node:16.13.1 + image: node:16.13.1-alpine commands: - cd frontend && npm install && npm run build @@ -17,7 +17,7 @@ steps: image: plugins/docker settings: context: docker/ - dockerfile: docker/Dockerfile + dockerfile: docker/Dockerfile.drone auto_tag: true repo: registry.xrg.io/xrg.es registry: https://registry.xrg.io diff --git a/docker/Dockerfile.drone b/docker/Dockerfile.drone new file mode 100644 index 0000000..ce2092c --- /dev/null +++ b/docker/Dockerfile.drone @@ -0,0 +1,25 @@ +FROM php:8.1-fpm-buster + +RUN apt update && apt install -y curl git + +# https://github.com/mlocati/docker-php-extension-installer +# https://github.com/mlocati/docker-php-extension-installer#special-requirements +RUN curl -sSLf -o /usr/local/bin/install-php-extensions \ + https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \ + chmod +x /usr/local/bin/install-php-extensions + +RUN install-php-extensions opcache redis timezonedb + +RUN apt clean autoclean && \ + apt autoremove -y && \ + rm -rf /var/lib/apt/lists/* + +RUN usermod -u 1000 www-data && groupmod -g 1000 www-data +RUN chown -R www-data:www-data /var/www + +RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" +COPY zz-custom-php.ini "$PHP_INI_DIR/conf.d/" +COPY zz-custom-phpfpm.conf /usr/local/etc/php-fpm.d/zz-docker.conf + +COPY /drone/src/frontend/build /var/www/frontend +COPY /drone/src/backend /var/www/backend \ No newline at end of file