chore: add docker file

هذا الالتزام موجود في:
2025-10-15 15:26:35 +03:00
الأصل 7f633d9855
التزام 2a00f2bda4
2 ملفات معدلة مع 82 إضافات و0 حذوفات

28
.dockerignore Normal file
عرض الملف

@@ -0,0 +1,28 @@
node_modules
vendor
.git
.github
.env
.env.example
.editorconfig
.gitignore
.gitattributes
docker-compose.yml
.idea
.vscode
*.log
storage/logs/*
storage/framework/cache/*
storage/framework/sessions/*
storage/framework/views/*
bootstrap/cache/*
!storage/app/.gitignore
!storage/app/public/.gitignore
!storage/framework/cache/.gitignore
!storage/framework/sessions/.gitignore
!storage/framework/views/.gitignore
!bootstrap/cache/.gitignore
tests
phpunit.xml
.phpunit.result.cache
README.md

54
Dockerfile Normal file
عرض الملف

@@ -0,0 +1,54 @@
FROM php:8.4-fpm-alpine
# Set working directory
WORKDIR /var/www/html
# Install system dependencies
RUN apk add --no-cache \
curl \
libpng-dev \
libzip-dev \
zip \
unzip \
git \
oniguruma-dev \
sqlite \
nodejs \
npm
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql pdo_sqlite mbstring exif pcntl bcmath gd zip
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy application files
COPY . .
# Install PHP dependencies
RUN composer install --no-dev --optimize-autoloader --no-interaction
# Install Node dependencies and build assets
RUN npm ci && npm run build && rm -rf node_modules
# Set permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache && \
chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
# Create SQLite database if it doesn't exist
RUN touch /var/www/html/database/database.sqlite && \
chown www-data:www-data /var/www/html/database/database.sqlite && \
chmod 664 /var/www/html/database/database.sqlite
# Switch to www-data user
USER www-data
# Expose port
EXPOSE 8000
# Start the application
CMD php artisan config:cache && \
php artisan route:cache && \
php artisan view:cache && \
php artisan migrate --force && \
php artisan serve --host=0.0.0.0 --port=8000