0
0
mirror of https://github.com/anthonyaxenov/iptv.git synced 2024-10-11 01:52:16 +00:00

Compose для дев/прод окружений

This commit is contained in:
Anthony Axenov 2024-09-15 18:01:28 +08:00
parent f0cfe4eda7
commit 2d5b9be5a0
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
8 changed files with 43 additions and 21 deletions

1
.env.example Normal file
View File

@ -0,0 +1 @@
IPTV_ENV=dev

3
.gitignore vendored
View File

@ -4,8 +4,7 @@ downloaded/
/src/commit
/src/cache/*
/src/vendor
/src/views/custom/*
!/src/views/custom/custom.twig.example
/src/views/custom.twig
*.log
.env
*.m3u

View File

@ -1,5 +1,3 @@
version: '3'
networks:
iptv:
driver: bridge
@ -8,14 +6,19 @@ services:
php:
container_name: iptv-php
build: 'docker/php'
env_file:
- .env
environment:
- PHP_IDE_CONFIG=serverName=iptv.local
build:
dockerfile: docker/php/${IPTV_ENV}.dockerfile
restart: unless-stopped
networks:
- iptv
volumes:
- /etc/localtime:/etc/localtime:ro
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf:ro
- ./docker/php/php.ini:/usr/local/etc/php/conf.d/php.ini:ro
- ./docker/php/${IPTV_ENV}.php.ini:/usr/local/etc/php/conf.d/php.ini:ro
- ./log/php:/var/log/php:rw
- ./src:/var/www:rw
- ./playlists.ini:/var/www/config/playlists.ini:ro

View File

@ -1,16 +1,17 @@
FROM php:8.1-fpm
FROM php:8.2-fpm
RUN apt update && \
apt upgrade -y && \
apt install -y git && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
apt install -y git unzip 7zip
# https://pecl.php.net/package/xdebug
RUN pecl channel-update pecl.php.net && \
pecl install xdebug-3.1.5 && \
pecl install xdebug-3.3.2 unzip && \
mkdir -p /var/log/php
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
EXPOSE 9000
WORKDIR /var/www
CMD composer install
CMD php-fpm
ENTRYPOINT php-fpm

View File

@ -15,18 +15,10 @@ opcache.jit = tracing
[xdebug]
; https://xdebug.org/docs/all_settings
; закомментировать для выключения
zend_extension = xdebug.so
; для отладки установить значение 'develop,debug'
xdebug.mode = develop
; для отладки при каждом запросе поменять 'trigger' на 'yes'
; иначе -- отправлять заголовок 'Cookie: XDEBUG_TRIGGER=go'
xdebug.start_with_request = trigger
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.trigger_value = go
xdebug.client_host = 172.17.0.1
xdebug.REQUEST = *
xdebug.SESSION = *

View File

@ -0,0 +1,12 @@
FROM php:8.2-fpm
RUN apt update && \
apt upgrade -y && \
apt install -y git
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
EXPOSE 9000
WORKDIR /var/www
CMD composer install
ENTRYPOINT php-fpm

14
docker/php/prod.php.ini Normal file
View File

@ -0,0 +1,14 @@
[PHP]
error_reporting = E_ALL
file_uploads = Off
; upload_max_filesize=10M
; post_max_size=10M
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 30000
opcache.revalidate_freq = 0
opcache.jit_buffer_size = 64M
opcache.jit = tracing