Files
kulakpos_web/Dockerfile

61 lines
1.6 KiB
Docker
Raw Normal View History

2026-03-16 04:20:00 +07:00
FROM php:8.2-fpm-alpine
2026-03-16 07:22:01 +07:00
# Install system dependencies
2026-03-16 04:20:00 +07:00
RUN apk add --no-cache \
libzip-dev \
postgresql-dev \
2026-03-16 06:45:23 +07:00
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
oniguruma-dev \
2026-03-16 07:22:01 +07:00
git \
curl \
2026-03-16 06:45:23 +07:00
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
2026-03-16 04:20:00 +07:00
&& docker-php-ext-install -j$(nproc) \
pdo_pgsql \
pgsql \
opcache \
zip \
2026-03-16 06:45:23 +07:00
bcmath \
gd \
exif \
2026-03-16 07:22:01 +07:00
pcntl
2026-03-16 04:20:00 +07:00
2026-03-16 06:41:29 +07:00
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
2026-03-16 04:20:00 +07:00
WORKDIR /var/www/html
2026-03-16 09:29:36 +07:00
# Copy all application files
2026-03-16 04:20:00 +07:00
COPY --chown=www-data:www-data . .
2026-03-16 07:22:01 +07:00
# Create the missing Helper file
RUN mkdir -p app/Helpers && \
2026-03-16 09:29:36 +07:00
echo "<?php\n\nnamespace App\Helpers;\n\nclass Helper\n{\n // Helper functions\n}\n" > app/Helpers/Helper.php
2026-03-16 07:22:01 +07:00
2026-03-16 09:57:31 +07:00
# 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
2026-03-16 07:22:01 +07:00
2026-03-16 09:57:31 +07:00
# 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
2026-03-16 10:20:15 +07:00
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
2026-03-16 04:20:00 +07:00
EXPOSE 8000 9000
2026-03-16 10:20:15 +07:00
ENTRYPOINT ["/entrypoint.sh"]