Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions php-dev/8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM digbang/php:8.2

LABEL version="1.0.0"
LABEL maintainer="Dario Govergun <dgovergun@digbang.com>, Mariano Filipoff <mfilipoff@digbang.com>"

# xdebug
RUN apk add --update linux-headers \
&& pecl install xdebug

# Composer install
COPY --from=composer:2.5 /usr/bin/composer /usr/bin/composer

# Setup www-data user
RUN apk add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data
RUN chown -R www-data:www-data ./
10 changes: 10 additions & 0 deletions php-dev/8.2/conf.d/docker-php-ext-opcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
zend_extension=opcache.so

[opcache]
opcache.enable=1
opcache.revalidate_freq=0
opcache.validate_timestamps=1
opcache.max_accelerated_files=10000
opcache.memory_consumption=192
opcache.max_wasted_percentage=10
opcache.interned_strings_buffer=16
8 changes: 8 additions & 0 deletions php-dev/8.2/conf.d/docker-php-ext-xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;zend_extension=xdebug.so

xdebug.remote_enable=0
xdebug.profiler_enable=0
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
xdebug.remote_handler=dbgp
xdebug.idekey=docker
30 changes: 30 additions & 0 deletions php-dev/8.2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

services:
nginx:
image: nginx:1.23.3-alpine
ports:
- 80:80
volumes:
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./:/var/www/html/
networks:
- app-network
working_dir: /var/www/html
command: nginx -g "daemon off;"
restart: unless-stopped
depends_on:
- php

php:
build: .
volumes:
- ./conf.d/:/usr/local/etc/php/conf.d/
- ./:/var/www/html/
networks:
- app-network
working_dir: /var/www/html

networks:
app-network:
driver: bridge
40 changes: 40 additions & 0 deletions php-dev/8.2/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
root /var/www/html/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

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$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
42 changes: 42 additions & 0 deletions php/8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM php:8.2-fpm-alpine

LABEL version="1.0.0"
LABEL maintainer="Dario Govergun <dgovergun@digbang.com>, Mariano Filipoff <mfilipoff@digbang.com>"

# Essentials
RUN echo "UTC" > /etc/timezone

RUN apk add --no-cache \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
libxml2-dev \
autoconf \
g++ \
imagemagick-dev \
libtool \
make \
curl \
sqlite \
mysql-dev \
postgresql-dev \
libzip-dev \
p7zip

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

# Installing PECL
RUN pecl install redis

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

# Configure PHP extensions
RUN docker-php-ext-install pdo pdo_pgsql pdo_mysql pgsql zip exif gd
RUN docker-php-ext-enable pdo pdo_pgsql pdo_mysql redis exif

# Clear APK cache
RUN rm -rf /var/cache/apk/*
4 changes: 4 additions & 0 deletions php/8.2/conf.d/docker-php-ext-opcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
zend_extension=opcache.so

[opcache]
opcache.enable=1
30 changes: 30 additions & 0 deletions php/8.2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

services:
nginx:
image: nginx:1.23.3-alpine
ports:
- 80:80
volumes:
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./:/var/www/html/
networks:
- app-network
working_dir: /var/www/html
command: nginx -g "daemon off;"
restart: unless-stopped
depends_on:
- php

php:
build: .
volumes:
- ./conf.d/:/usr/local/etc/php/conf.d/
- ./:/var/www/html/
networks:
- app-network
working_dir: /var/www/html

networks:
app-network:
driver: bridge
40 changes: 40 additions & 0 deletions php/8.2/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
root /var/www/html/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

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$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.(?!well-known).* {
deny all;
}
}