Search
 
SCRIPT & CODE EXAMPLE
 

PHP

docker : from php alpine

FROM alpine:latest

WORKDIR /var/www/html/

# Essentials
RUN echo "UTC" > /etc/timezone
RUN apk add --no-cache zip unzip curl sqlite nginx supervisor

# Installing bash
RUN apk add bash
RUN sed -i 's/bin/ash/bin/bash/g' /etc/passwd

# Installing PHP
RUN apk add --no-cache php8 
    php8-common 
    php8-fpm 
    php8-pdo 
    php8-opcache 
    php8-zip 
    php8-phar 
    php8-iconv 
    php8-cli 
    php8-curl 
    php8-openssl 
    php8-mbstring 
    php8-tokenizer 
    php8-fileinfo 
    php8-json 
    php8-xml 
    php8-xmlwriter 
    php8-simplexml 
    php8-dom 
    php8-pdo_mysql 
    php8-pdo_sqlite 
    php8-tokenizer 
    php8-pecl-redis

RUN ln -s /usr/bin/php8 /usr/bin/php

# Installing composer
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN rm -rf composer-setup.php

# Configure supervisor
RUN mkdir -p /etc/supervisor.d/
COPY .docker/supervisord.ini /etc/supervisor.d/supervisord.ini

# Configure PHP
RUN mkdir -p /run/php/
RUN touch /run/php/php8.0-fpm.pid

COPY .docker/php-fpm.conf /etc/php8/php-fpm.conf
COPY .docker/php.ini-production /etc/php8/php.ini

# Configure nginx
COPY .docker/nginx.conf /etc/nginx/
COPY .docker/nginx-laravel.conf /etc/nginx/modules/

RUN mkdir -p /run/nginx/
RUN touch /run/nginx/nginx.pid

RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log

# Building process
COPY . .
RUN composer install --no-dev
RUN chown -R nobody:nobody /var/www/html/storage

EXPOSE 80
CMD ["supervisord", "-c", "/etc/supervisor.d/supervisord.ini"]
Comment

PREVIOUS NEXT
Code Example
Php :: where in laravel 
Php :: instalar php 7.4 no ubuntu 
Php :: laravel model fillable vs guarded 
Php :: how to link image in laravel 
Php :: Warning: get_browser(): browscap ini directive not set in 
Php :: How to order by using id with firstWhere in laravel 
Php :: php filter non utf-8 characters 
Php :: if exists in string php 
Php :: grouping routes based on controller laravel 
Php :: php ?? 
Php :: php using composer autoload - own code 
Php :: laravel validation custom message 
Php :: how laravel return the old value 
Php :: laravel collection merge 
Php :: Get wordpress posts by category name..! 
Php :: sub menu for post type in wordpress 
Php :: laravel check if email is real 
Php :: laravel collection average 
Php :: config file php 
Php :: wordpress get plugin list 
Php :: php get first day of month 
Php :: php mod 
Php :: Laravel eloquent permanent soft delete 
Php :: write string variable in php 
Php :: laravel mysql specified key was too long 
Php :: PHP MySQL Use The ORDER BY Clause 
Php :: Round the number in php 
Php :: symlink.php laravel 
Php :: drupal 9 guzzle client increase timeout 
Php :: laravel number input positive only 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =