vorbereiten des docker deployments
This commit is contained in:
69
Dockerfile
Normal file
69
Dockerfile
Normal file
@@ -0,0 +1,69 @@
|
||||
FROM php:8.3-fpm-alpine AS php_build
|
||||
|
||||
ENV COMPOSER_ALLOW_SUPERUSER=1
|
||||
|
||||
RUN set -eux; \
|
||||
apk add --no-cache \
|
||||
icu-libs \
|
||||
libpng \
|
||||
libjpeg-turbo \
|
||||
freetype \
|
||||
libzip \
|
||||
bash \
|
||||
shadow \
|
||||
curl \
|
||||
git; \
|
||||
apk add --no-cache --virtual .build-deps \
|
||||
$PHPIZE_DEPS \
|
||||
icu-dev \
|
||||
libpng-dev \
|
||||
libjpeg-turbo-dev \
|
||||
freetype-dev \
|
||||
libzip-dev; \
|
||||
docker-php-ext-configure gd --with-freetype --with-jpeg; \
|
||||
docker-php-ext-install -j"$(nproc)" \
|
||||
bcmath \
|
||||
gd \
|
||||
intl \
|
||||
pcntl \
|
||||
pdo_mysql \
|
||||
zip \
|
||||
opcache; \
|
||||
pecl install redis; \
|
||||
docker-php-ext-enable redis; \
|
||||
apk del .build-deps
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY composer.json composer.lock ./
|
||||
|
||||
RUN set -eux; \
|
||||
composer install --no-dev --prefer-dist --optimize-autoloader --no-interaction
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN set -eux; \
|
||||
mkdir -p storage/app/public storage/logs bootstrap/cache; \
|
||||
chown -R www-data:www-data storage bootstrap/cache
|
||||
|
||||
FROM php_build AS php_app
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
CMD ["php-fpm"]
|
||||
|
||||
FROM nginx:alpine AS nginx
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY --from=php_app /var/www/html/public /var/www/html/public
|
||||
COPY --from=php_app /var/www/html/storage/app/public /var/www/html/storage/app/public
|
||||
|
||||
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM php:8.3-fpm-alpine AS php_build
|
||||
Reference in New Issue
Block a user