From d9f5e9770fec4ec02e85dfa0f96902e22add8504 Mon Sep 17 00:00:00 2001 From: Jaiden Date: Wed, 21 May 2025 17:50:42 -0400 Subject: [PATCH] setup docker --- Dockerfile | 35 +++++++++++ composer.json | 1 - composer.lock | 137 +------------------------------------------ docker-entrypoint.sh | 21 +++++++ 4 files changed, 57 insertions(+), 137 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b6ad33b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM php:8.4-fpm +WORKDIR /var/www/html + +RUN apt-get update && apt-get install -y \ + git \ + curl \ + libpng-dev \ + libonig-dev \ + libxml2-dev \ + libgmp-dev \ + zip \ + unzip \ + libzip-dev \ + nodejs \ + npm \ + netcat-traditional + +RUN apt-get clean && rm -rf /var/lib/apt/lists/* +RUN docker-php-ext-install mbstring exif pcntl bcmath gd zip gmp +RUN pecl install mongodb && docker-php-ext-enable mongodb + +RUN git config --global --add safe.directory /var/www/html +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +COPY docker-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-entrypoint.sh + +COPY . /var/www/html + +RUN composer install --optimize-autoloader --no-dev +RUN npm install && npm run build + +EXPOSE 9000 +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["php-fpm"] diff --git a/composer.json b/composer.json index 59b350d..c30e020 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "require": { "php": "^8.2", "ext-gmp": "*", - "intervention/image-driver-vips": "^1.0", "intervention/image-laravel": "^1.5", "laravel/framework": "^12.0", "laravel/sanctum": "^4.0", diff --git a/composer.lock b/composer.lock index 1904b57..ae5aad0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e877d0f75fea10b62d0f07df7c2cf227", + "content-hash": "91ba0ac099738f27d18cf80cec4b7d41", "packages": [ { "name": "brick/math", @@ -1261,80 +1261,6 @@ ], "time": "2025-02-27T13:08:55+00:00" }, - { - "name": "intervention/image-driver-vips", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/Intervention/image-driver-vips.git", - "reference": "080de0e638bcf508b5e79c2d88e82b0fd91b12b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Intervention/image-driver-vips/zipball/080de0e638bcf508b5e79c2d88e82b0fd91b12b0", - "reference": "080de0e638bcf508b5e79c2d88e82b0fd91b12b0", - "shasum": "" - }, - "require": { - "intervention/image": "^3.11.0", - "jcupitt/vips": "^2.4", - "php": "^8.1" - }, - "require-dev": { - "ext-fileinfo": "*", - "phpstan/phpstan": "^2", - "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0", - "slevomat/coding-standard": "~8.0", - "squizlabs/php_codesniffer": "^3.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Intervention\\Image\\Drivers\\Vips\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Oliver Vogel", - "email": "oliver@intervention.io", - "homepage": "https://intervention.io/" - }, - { - "name": "Thomas Picquet", - "email": "thomas@sctr.net" - } - ], - "description": "libvips driver for Intervention Image", - "homepage": "https://image.intervention.io/", - "keywords": [ - "image", - "libvips", - "vips" - ], - "support": { - "issues": "https://github.com/Intervention/image-driver-vips/issues", - "source": "https://github.com/Intervention/image-driver-vips/tree/1.0.5" - }, - "funding": [ - { - "url": "https://paypal.me/interventionio", - "type": "custom" - }, - { - "url": "https://github.com/Intervention", - "type": "github" - }, - { - "url": "https://ko-fi.com/interventionphp", - "type": "ko_fi" - } - ], - "time": "2025-05-05T13:53:52+00:00" - }, { "name": "intervention/image-laravel", "version": "1.5.6", @@ -1419,67 +1345,6 @@ ], "time": "2025-04-04T15:09:55+00:00" }, - { - "name": "jcupitt/vips", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/libvips/php-vips.git", - "reference": "a54c1cceea581b592a199edd61a7c06f44a24c08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/libvips/php-vips/zipball/a54c1cceea581b592a199edd61a7c06f44a24c08", - "reference": "a54c1cceea581b592a199edd61a7c06f44a24c08", - "shasum": "" - }, - "require": { - "ext-ffi": "*", - "php": ">=7.4", - "psr/log": "^1.1.3|^2.0|^3.0" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpdocumentor/shim": "^3.3", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jcupitt\\Vips\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Cupitt", - "email": "jcupitt@gmail.com", - "homepage": "https://github.com/jcupitt", - "role": "Developer" - } - ], - "description": "A high-level interface to the libvips image processing library.", - "homepage": "https://github.com/libvips/php-vips", - "keywords": [ - "image", - "libvips", - "processing" - ], - "support": { - "issues": "https://github.com/libvips/php-vips/issues", - "source": "https://github.com/libvips/php-vips/tree/v2.5.0" - }, - "time": "2025-04-04T17:10:13+00:00" - }, { "name": "laravel/framework", "version": "v12.15.0", diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..96a9658 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +mkdir -p /var/www/html/storage/framework/cache +mkdir -p /var/www/html/storage/framework/sessions +mkdir -p /var/www/html/storage/framework/views +mkdir -p /var/www/html/storage/app/public +mkdir -p /var/www/html/bootstrap/cache + +chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache +chown -R 775 /var/www/html/storage /var/www/html/bootstrap/cache + +if [ -z "$(grep '^APP_KEY=' .env | grep -v '=$')" ]; then + php artisan key:generate +fi + +if [ "$DB_HOST" != "" ]; then + php artisan migrate +fi + +exec "$@"