File size: 1,021 Bytes
bc63d7d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | FROM php:8.3-cli-alpine
# Install system dependencies
RUN apk add --no-cache \
git \
unzip \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
icu-dev \
sqlite-dev
# Configure and install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd \
zip \
intl \
pdo_mysql \
mysqli \
pdo_sqlite
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy application files (observing .hfignore)
COPY . .
# Run Composer Install to ensure all vendor dependencies exist (including platform-reqs since we installed extension libraries in the container)
RUN composer install --no-dev --optimize-autoloader
# Ensure proper permissions
RUN chmod -R 777 /var/www/html
# Expose port 7860
EXPOSE 7860
# Start PHP built-in web server with our router
CMD ["php", "-S", "0.0.0.0:7860", "router.php"]
|