fix pipeline
This commit is contained in:
21
Dockerfile
21
Dockerfile
@@ -1,9 +1,11 @@
|
||||
FROM php:8.2-fpm-alpine
|
||||
|
||||
# Install PostgreSQL extensions
|
||||
# Install dependencies
|
||||
RUN apk add --no-cache \
|
||||
libzip-dev \
|
||||
postgresql-dev \
|
||||
git \
|
||||
curl \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
pdo_pgsql \
|
||||
pgsql \
|
||||
@@ -15,12 +17,21 @@ RUN apk add --no-cache \
|
||||
opcache \
|
||||
zip
|
||||
|
||||
# Install Composer
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Copy composer files first (for better caching)
|
||||
COPY composer.json composer.lock ./
|
||||
|
||||
# Install dependencies
|
||||
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader
|
||||
|
||||
# Copy application files
|
||||
COPY --chown=www-data:www-data . .
|
||||
|
||||
# Create all necessary directories with proper permissions
|
||||
# Create necessary directories
|
||||
RUN mkdir -p storage/framework/{cache,sessions,views} \
|
||||
&& mkdir -p storage/logs \
|
||||
&& mkdir -p bootstrap/cache \
|
||||
@@ -29,7 +40,7 @@ RUN mkdir -p storage/framework/{cache,sessions,views} \
|
||||
&& chmod 777 storage/framework/sessions \
|
||||
&& chmod 777 storage/logs
|
||||
|
||||
# Create startup script to handle different modes
|
||||
# Create startup script
|
||||
RUN echo '#!/bin/sh' > /start.sh && \
|
||||
echo 'if [ "$MODE" = "dev" ]; then' >> /start.sh && \
|
||||
echo ' echo "Starting in DEV mode with PHP built-in server on port 8000..."' >> /start.sh && \
|
||||
@@ -40,10 +51,6 @@ RUN echo '#!/bin/sh' > /start.sh && \
|
||||
echo 'fi' >> /start.sh && \
|
||||
chmod +x /start.sh
|
||||
|
||||
# Verify permissions (for debugging)
|
||||
RUN ls -la storage/framework/
|
||||
|
||||
EXPOSE 8000 9000
|
||||
|
||||
# Use the startup script
|
||||
CMD ["/start.sh"]
|
||||
Reference in New Issue
Block a user