diff --git a/compose.yml b/compose.yml index f47276f..9d9fba7 100644 --- a/compose.yml +++ b/compose.yml @@ -20,13 +20,13 @@ services: <<: *common-attributes container_name: iptv-keydb image: eqalpha/keydb:latest - user: "${KEYDB_UID}:${KEYDB_GID}" + user: ${KEYDB_UID}:${KEYDB_GID} volumes: - ./docker/keydb/keydb.conf:/etc/keydb/keydb.conf - ./docker/keydb/data/:/data:rw - ./log/keydb:/var/log/keydb/:rw ports: - - "${KEYDB_PORT:-6379}:6379" + - ${KEYDB_PORT:-6379}:6379 web: <<: *common-attributes @@ -39,7 +39,6 @@ services: - ./docker/php/${IPTV_ENV}/www.conf:/usr/local/etc/php-fpm.d/www.conf:ro - ./docker/php/${IPTV_ENV}/php.ini:/usr/local/etc/php/conf.d/php.ini:ro - ./playlists/playlists.ini:/var/www/config/playlists.ini - # - ./playlists/channels.json:/var/www/config/channels.json - ./log/php:/var/log/php:rw - ./web:/var/www:rw depends_on: @@ -78,8 +77,9 @@ services: - ./docker/nginx/vhost.conf:/etc/nginx/conf.d/default.conf:ro - ./log/nginx:/var/log/nginx:rw - ./web:/var/www:ro + - ./docs/site:/usr/share/nginx/html/doc-files:ro ports: - - "8080:80" + - 8080:80 links: - web depends_on: diff --git a/docker/nginx/vhost.conf b/docker/nginx/vhost.conf index a6e6e5b..8d0080d 100644 --- a/docker/nginx/vhost.conf +++ b/docker/nginx/vhost.conf @@ -1,8 +1,14 @@ server { server_name iptv.local; listen 80; - root /var/www/public; - index index.php; + index index.html index.php; + # access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log warn; + add_header Access-Control-Allow-Origin '*'; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + add_header Access-Control-Allow-Headers "*"; + add_header Access-Control-Allow-Credentials "true"; + gzip on; gzip_vary on; gzip_proxied any; @@ -10,15 +16,29 @@ server { gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { - access_log off; - expires max; - log_not_found off; + + location = /docs { + return 301 /docs/; } + + location ^~ /docs/ { + alias /usr/share/nginx/html/doc-files/; + index index.html; + # access_log /var/log/nginx/docs_access.log; + error_log /var/log/nginx/docs_error.log warn; + location ~* \.(?:js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1y; + add_header Cache-Control "public"; + } + } + location / { + root /var/www/public; try_files $uri $uri/ /index.php$is_args$args; } + location ~ \.php$ { + root /var/www/public; try_files $uri /index.php =404; fastcgi_pass web:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -29,5 +49,17 @@ server { fastcgi_read_timeout 300; proxy_read_timeout 300; include fastcgi_params; + location ~* \.(jpg|jpeg|gif|css|png|ttf|woff|svg|js|ico)$ { + access_log off; + expires max; + log_not_found off; + } + } + + location ~* \.(jpg|jpeg|gif|css|png|ttf|woff|svg|js|ico)$ { + root /var/www/public; + access_log off; + expires max; + log_not_found off; } } diff --git a/dockerfile.web.prod b/dockerfile.web.prod index 84e6d7d..e5623d3 100644 --- a/dockerfile.web.prod +++ b/dockerfile.web.prod @@ -29,6 +29,6 @@ COPY --from=composer /usr/bin/composer /usr/local/bin/composer RUN git config --global --add safe.directory /var/www EXPOSE 9000 -WORKDIR /var/www -RUN composer install -ENTRYPOINT php-fpm --nodaemonize +WORKDIR /var/www/ +CMD composer install && \ + php-fpm --nodaemonize diff --git a/docs b/docs new file mode 160000 index 0000000..3a2eca9 --- /dev/null +++ b/docs @@ -0,0 +1 @@ +Subproject commit 3a2eca9e15774fdc147a881acaf83baf046ce9f3 diff --git a/iptv b/iptv index 3cc70b5..af090b0 100755 --- a/iptv +++ b/iptv @@ -21,7 +21,7 @@ else ROOT_PATH="$(pwd)" fi -IPTV_PROJECTS=("iptvc" "web" "playlists") +IPTV_PROJECTS=("iptvc" "docs" "web" "playlists") IPTV_GITEA_URL_SSH="git@git.axenov.dev:IPTV" IPTV_GITEA_URL_HTTPS="https://git.axenov.dev/IPTV" IPTV_DOCKER_URL_SSH="$IPTV_GITEA_URL_SSH/iptv-docker.git"