FROM webdevops/php-nginx:7.4-alpine # Set working directory WORKDIR /var/www/html ENV WEB_DOCUMENT_ROOT /var/www/html/public ENV APP_ENV production ENV WEB_ALIAS_DOMAIN chess.basys.co.id/ # Copy project ke dalam container COPY . /var/www/html RUN apk add oniguruma-dev git nano postgresql-dev libxml2-dev RUN docker-php-ext-install \ bcmath \ ctype \ fileinfo \ json \ mbstring \ pdo_mysql \ pdo_pgsql \ tokenizer \ xml # Install composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Copy directory project permission ke container COPY --chown=www-data:www-data . /var/www/html RUN chown -R www-data:www-data /var/www/html # Install dependency RUN composer install --no-interaction --optimize-autoloader --no-dev # Optimizing Configuration loading RUN php artisan optimize:clear # Ganti user ke www-data USER www-data Expose 8200