setup docker

This commit is contained in:
yuriko 🦊 2025-05-21 17:50:42 -04:00
parent be4c848eee
commit d9f5e9770f
Signed by: jaiden
SSH key fingerprint: SHA256:f8tvveBoXBrKZIQDWLLcpQrKbATUCGg98x2N4YzkDM8
4 changed files with 57 additions and 137 deletions

35
Dockerfile Normal file
View file

@ -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"]

View file

@ -11,7 +11,6 @@
"require": { "require": {
"php": "^8.2", "php": "^8.2",
"ext-gmp": "*", "ext-gmp": "*",
"intervention/image-driver-vips": "^1.0",
"intervention/image-laravel": "^1.5", "intervention/image-laravel": "^1.5",
"laravel/framework": "^12.0", "laravel/framework": "^12.0",
"laravel/sanctum": "^4.0", "laravel/sanctum": "^4.0",

137
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "e877d0f75fea10b62d0f07df7c2cf227", "content-hash": "91ba0ac099738f27d18cf80cec4b7d41",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
@ -1261,80 +1261,6 @@
], ],
"time": "2025-02-27T13:08:55+00:00" "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", "name": "intervention/image-laravel",
"version": "1.5.6", "version": "1.5.6",
@ -1419,67 +1345,6 @@
], ],
"time": "2025-04-04T15:09:55+00:00" "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", "name": "laravel/framework",
"version": "v12.15.0", "version": "v12.15.0",

21
docker-entrypoint.sh Normal file
View file

@ -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 "$@"