buat docker
This commit is contained in:
67
Dockerfile
Normal file
67
Dockerfile
Normal file
@@ -0,0 +1,67 @@
|
||||
FROM node:24-bookworm-slim AS assets
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY resources ./resources
|
||||
COPY vite.config.js ./
|
||||
RUN npm run build
|
||||
FROM composer:2 AS composer
|
||||
FROM php:8.4-apache AS app
|
||||
WORKDIR /var/www/html
|
||||
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public \
|
||||
COMPOSER_ALLOW_SUPERUSER=1
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
default-mysql-client \
|
||||
git \
|
||||
libfreetype6-dev \
|
||||
libicu-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libmagickwand-dev \
|
||||
libpng-dev \
|
||||
libzip-dev \
|
||||
unzip \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j"$(nproc)" \
|
||||
bcmath \
|
||||
exif \
|
||||
gd \
|
||||
intl \
|
||||
opcache \
|
||||
pcntl \
|
||||
pdo_mysql \
|
||||
zip \
|
||||
&& pecl install imagick \
|
||||
&& docker-php-ext-enable imagick \
|
||||
&& a2enmod rewrite headers remoteip \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/pear
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
COPY composer.json composer.lock ./
|
||||
RUN composer install \
|
||||
--no-dev \
|
||||
--no-interaction \
|
||||
--no-progress \
|
||||
--prefer-dist \
|
||||
--no-scripts \
|
||||
--optimize-autoloader
|
||||
COPY . .
|
||||
COPY --from=assets /app/public/build ./public/build
|
||||
COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
||||
COPY docker/php/production.ini /usr/local/etc/php/conf.d/99-production.ini
|
||||
COPY --chmod=755 docker/entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||
RUN mkdir -p \
|
||||
storage/app/public \
|
||||
storage/framework/cache/data \
|
||||
storage/framework/sessions \
|
||||
storage/framework/testing \
|
||||
storage/framework/views \
|
||||
storage/logs \
|
||||
bootstrap/cache \
|
||||
&& chown -R www-data:www-data storage bootstrap/cache \
|
||||
&& composer dump-autoload --optimize \
|
||||
&& php artisan package:discover --ansi
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["docker-entrypoint"]
|
||||
CMD ["apache2-foreground"]
|
||||
Reference in New Issue
Block a user