60 lines
1.3 KiB
Docker
Executable File
60 lines
1.3 KiB
Docker
Executable File
FROM php:8.3-fpm
|
|
|
|
# System deps
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
unzip \
|
|
zip \
|
|
libpng-dev \
|
|
libonig-dev \
|
|
libxml2-dev \
|
|
libzip-dev \
|
|
libicu-dev \
|
|
default-mysql-client \
|
|
mdbtools \
|
|
nodejs \
|
|
npm \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# PHP extensions
|
|
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd intl zip
|
|
|
|
# Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
WORKDIR /var/www
|
|
|
|
# Copy app
|
|
COPY . /var/www
|
|
|
|
# Laravel needs these writable directories during composer package discovery.
|
|
RUN mkdir -p \
|
|
/var/www/bootstrap/cache \
|
|
/var/www/storage/app \
|
|
/var/www/storage/framework/cache \
|
|
/var/www/storage/framework/cache/data \
|
|
/var/www/storage/framework/sessions \
|
|
/var/www/storage/framework/views \
|
|
/var/www/storage/logs
|
|
|
|
ENV VIEW_COMPILED_PATH=/var/www/storage/framework/views
|
|
|
|
# Install deps + build assets
|
|
RUN composer install --no-dev --optimize-autoloader \
|
|
&& npm install \
|
|
&& npm run build
|
|
|
|
# Permissions
|
|
RUN chown -R www-data:www-data /var/www \
|
|
&& chmod -R 775 /var/www/storage \
|
|
&& chmod -R 775 /var/www/bootstrap/cache
|
|
|
|
COPY ./docker/entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
EXPOSE 9000
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
CMD ["php-fpm"]
|