Files
kulakpos_web/Dockerfile
eko fc0669d58e
All checks were successful
Build, Push and Deploy / build-and-deploy (push) Successful in 2m29s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
fix dockerfile
2026-03-16 10:20:15 +07:00

61 lines
1.6 KiB
Docker

FROM php:8.2-fpm-alpine
# Install system dependencies
RUN apk add --no-cache \
libzip-dev \
postgresql-dev \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
oniguruma-dev \
git \
curl \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
pdo_pgsql \
pgsql \
opcache \
zip \
bcmath \
gd \
exif \
pcntl
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# Copy all application files
COPY --chown=www-data:www-data . .
# Create the missing Helper file
RUN mkdir -p app/Helpers && \
echo "<?php\n\nnamespace App\Helpers;\n\nclass Helper\n{\n // Helper functions\n}\n" > app/Helpers/Helper.php
# CRITICAL: Create storage directories BEFORE composer install
RUN mkdir -p storage/framework/{cache,sessions,views} \
&& mkdir -p storage/logs \
&& mkdir -p bootstrap/cache \
&& chmod -R 777 storage \
&& chmod -R 777 bootstrap/cache
# Verify directories exist (debug)
RUN ls -la storage/framework/ && ls -la bootstrap/
# Install dependencies with --no-scripts first to avoid post-install commands
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts
# Now run the post-install scripts (storage exists now)
RUN composer run-script post-autoload-dump || echo "Post-autoload dump skipped"
# Generate key if needed
RUN php artisan key:generate --no-interaction --force || true
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8000 9000
ENTRYPOINT ["/entrypoint.sh"]