Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m51s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
Build, Push and Deploy / deploy-staging (push) Has been skipped
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
70 lines
1.6 KiB
Docker
70 lines
1.6 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 \
|
|
nodejs \
|
|
npm \
|
|
&& 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 first (including artisan)
|
|
COPY --chown=www-data:www-data . .
|
|
|
|
# Remove any nested vendor directories to avoid conflicts
|
|
RUN find . -type d -name "vendor" -not -path "./vendor*" -exec rm -rf {} + 2>/dev/null || true
|
|
|
|
# Create necessary directories
|
|
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
|
|
|
|
# Install PHP dependencies (artisan file now exists)
|
|
RUN composer install --no-interaction --no-progress --optimize-autoloader
|
|
|
|
# Copy package files for NPM
|
|
COPY package*.json ./
|
|
COPY vite.config.js ./
|
|
|
|
# Install NPM dependencies
|
|
RUN npm install --legacy-peer-deps --no-audit
|
|
|
|
# Build Vite assets
|
|
RUN npm run build
|
|
|
|
# Run package discovery
|
|
RUN php artisan package:discover --ansi || true
|
|
|
|
# Generate application key
|
|
RUN php artisan key:generate --no-interaction --force || true
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
EXPOSE 8000 9000
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"] |