diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0fc32aa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +.git +.env +node_modules +vendor +storage/framework/cache/data/* +storage/framework/sessions/* +storage/framework/testing/* +storage/framework/views/* +storage/logs/* +public/storage +.phpunit.result.cache +.vscode +.idea +.devcontainer +docker-compose.yml +Dockerfile +.dockerignore +Makefile +k8s/ diff --git a/Dockerfile b/Dockerfile index f6cdc77..f37f0d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,35 @@ FROM php:8.4-fpm -COPY . /app -WORKDIR /app +# Install system dependencies +RUN apt-get update && apt-get install -y \ + git \ + curl \ + libpng-dev \ + libonig-dev \ + libxml2-dev \ + zip \ + unzip \ + libzip-dev \ + libicu-dev +# Clear cache +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install PHP extensions +RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip intl + +# Get latest Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Set working directory +WORKDIR /var/www + +# Copy existing application directory contents +COPY --chown=www-data:www-data . /var/www + +# Change current user to www +USER www-data + +# Expose port 8000 and start php-fpm server +EXPOSE 8000 CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]