All checks were successful
continuous-integration/drone/push Build is passing
50 lines
1.0 KiB
Docker
50 lines
1.0 KiB
Docker
FROM php:8.3-fpm
|
|
|
|
# Install system dependencies & PHP extensions
|
|
RUN apt-get update && apt-get install -y \
|
|
libzip-dev \
|
|
unzip \
|
|
git \
|
|
libpq-dev \
|
|
libicu-dev \
|
|
zip \
|
|
curl \
|
|
&& docker-php-ext-install \
|
|
intl \
|
|
zip \
|
|
pdo_pgsql \
|
|
bcmath
|
|
|
|
# Install Composer
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www
|
|
|
|
# Copy source
|
|
COPY . .
|
|
COPY .env.example .env
|
|
|
|
# Set permission
|
|
RUN chown -R www-data:www-data /var/www
|
|
|
|
USER www-data
|
|
|
|
# Install dependencies & generate app key
|
|
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
# Uncomment if you want to generate key automatically (optional)
|
|
# RUN php artisan key:generate
|
|
|
|
USER root
|
|
|
|
# Set storage & cache permission
|
|
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache \
|
|
&& chmod -R 775 /var/www/storage /var/www/bootstrap/cache
|
|
|
|
# Expose default Laravel serve port
|
|
EXPOSE 8000
|
|
|
|
# Use artisan serve instead of php-fpm
|
|
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]
|