Files
kulakpos_web/Dockerfile
eko edfc0f0680
Some checks failed
Build, Push and Deploy / build-and-deploy (push) Failing after 1m46s
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 8s
fix docker
2026-03-23 11:27:36 +07:00

56 lines
1.3 KiB
Docker

FROM php:8.2-fpm-alpine
# Install system dependencies
RUN apk add --no-cache \
vim \
xxd \
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 ONLY composer files first (for better caching)
COPY composer.json composer.lock* ./
# Install dependencies (including laravel/prompts)
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader
# Copy the rest of the application files
COPY --chown=www-data:www-data . .
# Create storage directories after copying files
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
# Generate key (after composer install and storage setup)
RUN php artisan key:generate --no-interaction --force
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8000 9000
ENTRYPOINT ["/entrypoint.sh"]