Add base image
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Philipp Lang 2023-08-15 16:42:15 +02:00
parent e8e309fccd
commit 6dffb8d4ff
3 changed files with 11 additions and 14 deletions

9
.docker/base.Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM php:8.1.6-fpm as php
WORKDIR /app
RUN apt-get update
RUN apt-get install -y rsync libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev unzip
RUN apt-get install -y --no-install-recommends texlive-base texlive-latex-base texlive-pictures texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended texlive-fonts-extra
RUN docker-php-ext-install pdo_mysql curl gd exif intl mbstring pcntl
RUN pecl install redis && docker-php-ext-enable redis
RUN usermod -s /bin/bash www-data

View File

@ -8,17 +8,10 @@ WORKDIR /app
COPY . /app
RUN npm install && npm run prod && npm run img && rm -R node_modules
FROM php:8.1.6-fpm as php
WORKDIR /app
RUN apt-get update
RUN apt-get install -y rsync libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev unzip
RUN apt-get install -y --no-install-recommends texlive-base texlive-latex-base texlive-pictures texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended texlive-fonts-extra
RUN docker-php-ext-install pdo_mysql curl gd exif intl mbstring pcntl
RUN pecl install redis && docker-php-ext-enable redis
FROM zoomyboy/adrema-base:latest as php
COPY --chown=www-data:www-data . /app
COPY --chown=www-data:www-data --from=node /app/public /app/public
COPY --chown=www-data:www-data --from=composer /app/vendor /app/vendor
RUN usermod -s /bin/bash www-data
USER www-data
RUN php artisan telescope:publish

View File

@ -27,13 +27,8 @@ steps:
- npm ci && npm run img && npm run prod && rm -R node_modules
- name: tests
image: php:8.1.6
image: zoomyboy/adrema-base:latest
commands:
- apt-get update > /dev/null
- apt-get install -y rsync libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev unzip > /dev/null
- apt-get install -y --no-install-recommends texlive-base texlive-latex-base texlive-pictures texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended texlive-fonts-extra > /dev/null
- docker-php-ext-install pdo_mysql curl gd exif intl mbstring pcntl > /dev/null
- pecl install redis && docker-php-ext-enable redis > /dev/null
- php artisan migrate
- php artisan test
- rm -f .env