trip-planner/docker/backend/Dockerfile.dev

44 lines
1.3 KiB
Text
Raw Permalink Normal View History

2025-09-26 01:13:44 +02:00
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 \
2025-09-27 11:14:43 +02:00
shadow \
linux-headers \
$PHPIZE_DEPS
2025-09-26 01:13:44 +02:00
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
2025-09-27 11:14:43 +02:00
# Install Xdebug for code coverage
RUN pecl install xdebug && \
docker-php-ext-enable xdebug
# Configure Xdebug for coverage (not debugging)
RUN echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo "xdebug.start_with_request=no" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
2025-09-26 01:13:44 +02:00
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# Create storage and bootstrap/cache directories with proper permissions
RUN mkdir -p storage/app/public storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache && \
chmod -R 777 storage bootstrap/cache
2025-09-26 01:13:44 +02:00
# Run as root to avoid permission issues with volume mounts
2025-09-26 01:13:44 +02:00
# 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 migrate --force && php artisan serve --host=0.0.0.0 --port=8000"