dockerfile for drone build
continuous-integration/drone/push Build encountered an error Details

This commit is contained in:
Sergio Álvarez 2022-01-10 11:51:12 +01:00
parent 2920289a0e
commit 90d20908e5
No known key found for this signature in database
GPG Key ID: 622780889DFDBDA5
2 changed files with 28 additions and 3 deletions

View File

@ -4,12 +4,12 @@ name: default
steps: steps:
- name: backend - name: backend
image: composer:2.1.14 image: composer:2.1.14-alpine
commands: commands:
- cd backend && composer install - cd backend && composer install
- name: frontend - name: frontend
image: node:16.13.1 image: node:16.13.1-alpine
commands: commands:
- cd frontend && npm install && npm run build - cd frontend && npm install && npm run build
@ -17,7 +17,7 @@ steps:
image: plugins/docker image: plugins/docker
settings: settings:
context: docker/ context: docker/
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.drone
auto_tag: true auto_tag: true
repo: registry.xrg.io/xrg.es repo: registry.xrg.io/xrg.es
registry: https://registry.xrg.io registry: https://registry.xrg.io

25
docker/Dockerfile.drone Normal file
View File

@ -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