33 lines
991 B
Docker
33 lines
991 B
Docker
FROM php:8.4-cli
|
|
|
|
WORKDIR /var/www/html
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends git unzip libonig-dev libzip-dev \
|
|
&& docker-php-ext-install bcmath mbstring pdo_mysql zip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
|
|
|
COPY composer.json composer.lock ./
|
|
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install \
|
|
--no-dev \
|
|
--prefer-dist \
|
|
--no-interaction \
|
|
--no-progress \
|
|
--no-scripts \
|
|
--optimize-autoloader
|
|
|
|
COPY . .
|
|
COPY docker/entrypoint.sh /usr/local/bin/hafiz-entrypoint
|
|
|
|
RUN chmod +x /usr/local/bin/hafiz-entrypoint \
|
|
&& mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache \
|
|
&& chown -R www-data:www-data storage bootstrap/cache \
|
|
&& COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload --optimize
|
|
|
|
EXPOSE 8000
|
|
|
|
ENTRYPOINT ["hafiz-entrypoint"]
|
|
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]
|