Files
ponzi/Dockerfile
Ivo Spijkerman cdbf09e5e4 add Docker setup
2025-08-31 16:30:27 +02:00

50 lines
1.2 KiB
Docker

# Multi-stage build for smaller final image
FROM php:8.4-fpm-alpine AS base
# Install system dependencies
RUN apk add --no-cache \
nginx \
supervisor \
curl \
zip \
unzip \
git \
oniguruma-dev \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
postgresql-dev \
mysql-client
# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo pdo_mysql pdo_pgsql mbstring exif pcntl bcmath gd zip
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy config files
COPY docker/etc/nginx/http.d/default.conf /etc/nginx/http.d/default.conf
COPY docker/etc/supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY docker/start.sh ./start.sh
COPY .env.example ./.env
# Copy application files
COPY . .
# Install dependencies
RUN composer install --no-dev --optimize-autoloader
# Set permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache \
&& chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
EXPOSE 80
CMD ["./start.sh"]