43 lines
No EOL
1.1 KiB
Text
43 lines
No EOL
1.1 KiB
Text
FROM php:8.3-fpm-alpine
|
|
|
|
# Install system dependencies
|
|
RUN apk add --no-cache \
|
|
git \
|
|
curl \
|
|
libpng-dev \
|
|
oniguruma-dev \
|
|
libxml2-dev \
|
|
zip \
|
|
unzip \
|
|
nodejs \
|
|
npm \
|
|
shadow
|
|
|
|
# Install PHP extensions
|
|
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
|
|
|
|
# Install Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
WORKDIR /var/www/html
|
|
|
|
# Create developer user with UID 1000 (same as host user)
|
|
RUN adduser -u 1000 -s /bin/sh -D developer
|
|
|
|
# Create storage and bootstrap/cache directories
|
|
RUN mkdir -p storage/app/public storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache
|
|
|
|
# Change ownership to developer user
|
|
RUN chown -R developer:developer /var/www/html
|
|
|
|
# Set proper permissions for Laravel directories
|
|
RUN chmod -R 775 storage bootstrap/cache
|
|
|
|
# Switch to developer user
|
|
USER developer
|
|
|
|
# Expose port 8000 for artisan serve
|
|
EXPOSE 8000
|
|
|
|
# Start Laravel development server with composer install
|
|
CMD sh -c "composer install && php artisan key:generate --force && php artisan serve --host=0.0.0.0 --port=8000" |