Skip to content

Instantly share code, notes, and snippets.

@LucasSouzaa
Created November 27, 2023 15:24
Show Gist options
  • Select an option

  • Save LucasSouzaa/f98ef2aa97bf117d3ed78d52c5df80f7 to your computer and use it in GitHub Desktop.

Select an option

Save LucasSouzaa/f98ef2aa97bf117d3ed78d52c5df80f7 to your computer and use it in GitHub Desktop.
FROM php:7.2-fpm
WORKDIR /var/www
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN apt-get update && apt-get install -y \
build-essential \
mariadb-client \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
unzip \
git \
curl \
telnet \
libmagickwand-dev \
nginx
RUN apt-get update && apt-get install -y libc-client-dev libkrb5-dev && rm -r /var/lib/apt/lists/*
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap
RUN docker-php-ext-install bcmath
RUN pecl install imagick
RUN pecl install -f xdebug-3.1.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini;
RUN pecl install mongodb-1.14.0
RUN mkdir -p /usr/share/man/man1
RUN apt-get update && apt-get install -y \
wget \
libbcprov-java \
libcommons-lang3-java \
default-jre-headless && cd /tmp && wget http://fr.archive.ubuntu.com/ubuntu/pool/universe/p/pdftk-java/pdftk-java_3.2.2-1_all.deb && dpkg -i pdftk-java_3.2.2-1_all.deb
# Install supervisor
RUN apt-get install -y supervisor
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-enable imagick
RUN docker-php-ext-enable mongodb
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install gd
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && docker-php-ext-install imap
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY . /var/www
COPY ./docker/supervisor_data.conf /etc/supervisord.conf
COPY ./docker/php.ini /usr/local/etc/php/conf.d/app.ini
COPY ./docker/nginx.conf /etc/nginx/sites-enabled/default
COPY ./docker/start-container /usr/local/bin/start-container
RUN chmod +x /usr/local/bin/start-container
USER 1000
EXPOSE 8000
server {
listen 8000;
root /var/www/;
error_log /dev/stdout;
access_log /dev/stdout;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php index.html;
charset utf-8;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_buffering off;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
}
log_errors=1
display_errors=0
post_max_size=40M
upload_max_filesize=40M
display_startup_errors=1
error_log=/dev/stdout
#!/bin/sh
/usr/bin/supervisord -c /etc/supervisord.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment