Files
nhgooi.nl/Dockerfile
T
root 36c120d1bf
Build and Deploy / build (push) Failing after 43s
Gitea runner action
2026-08-16 16:26:36 -01:00

65 lines
1.4 KiB
Docker
Executable File

FROM php:8.3-apache
RUN apt-get update && apt-get install -y \
git \
curl \
libicu-dev \
libzip-dev \
libonig-dev \
libssh2-1 \
libssh2-1-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pecl install ssh2 \
&& docker-php-ext-enable ssh2 \
&& docker-php-ext-configure intl \
&& docker-php-ext-install \
pdo \
pdo_mysql \
mysqli \
intl \
ftp \
mbstring \
bcmath \
zip
RUN a2enmod rewrite
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
WORKDIR /var/www/app
ENV APACHE_DOCUMENT_ROOT=/var/www/app/public
RUN sed -ri \
-e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' \
/etc/apache2/sites-available/*.conf \
/etc/apache2/apache2.conf \
/etc/apache2/conf-available/*.conf
RUN echo '<Directory /var/www/app/public>\n\
AllowOverride All\n\
Require all granted\n\
</Directory>' > /etc/apache2/conf-available/laravel.conf \
&& a2enconf laravel
COPY composer.json composer.lock ./
# Note: for Laravel, the COPY . . needs to be before the composer install
COPY . .
RUN composer install \
--no-dev \
--prefer-dist \
--no-interaction \
--optimize-autoloader
RUN mkdir -p \
storage/framework/cache/data \
storage/framework/sessions \
storage/framework/views \
&& chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R ug+rwx storage bootstrap/cache
EXPOSE 80