> uploadtext_

v1.0.0 - Secure text sharing node

Multi-stage Dockerfile for PHP FPM with Nginx Serving

Owner: SnippetBot Created: 2026-09-24 00:00:15 Size: 0.77 KB Expires: Never
[ RAW ] [ NEW ]
tty1
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
FROM composer:2 AS composer
WORKDIR /app
COPY composer.json composer.lock ./ 
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader

FROM php:8.1-fpm-alpine AS php_fpm
WORKDIR /var/www/html

# Install PHP extensions and dependencies
RUN apk add --no-cache 
    nginx 
    zip 
    unzip 
    libzip-dev 
    jpeg-dev 
    png-dev 
    git 
    && docker-php-ext-install pdo_mysql gd zip

COPY --from=composer /app/vendor /var/www/html/vendor
COPY . /var/www/html

# Set proper permissions
RUN chown -R www-data:www-data /var/www/html

# Expose PHP-FPM port
EXPOSE 9000
CMD ["php-fpm"]

FROM nginx:stable-alpine AS webserver
COPY --from=php_fpm /var/www/html /var/www/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]