Всем привет. Получаю ошибку: connect() to unix:/var/run/php8-fpm.sock . Работаю под windows. По порту всё работает, а
вот по сокетам нет. Возможно ли создать сокет на винде?
Или в чём может быть проблема?
docker-compose.yml:
version: '3'
services:
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
image: myapp/nginx
container_name: webserver
ports:
- 8080:80
volumes:
- ./data/htdocs:/data/mysite.local
- ./data/log/nginx:/var/log/nginx
- phpsocket:/var/run
networks:
- app-network
app:
build:
context: ./app
dockerfile: Dockerfile
image: myapp/php
container_name: app
volumes:
- ./data/htdocs:/data/mysite.local
- ./data/log/php:/var/log/php
- phpsocket:/var/run
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
phpsocket:
./nginx/DockerFile
FROM nginx
COPY ./mysite.local.conf /etc/nginx/conf.d/mysite.local.conf
WORKDIR /data
EXPOSE 80
app/Dockerfile
FROM php:8.2-fpm
EXPOSE 9000
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libonig-dev \
libzip-dev \
libmcrypt-dev \
&& docker-php-ext-install -j$(nproc) iconv mbstring mysqli pdo_mysql zip \
&& docker-php-ext-configure sockets \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY ./php.ini /usr/local/etc/php/conf.d/php-custom.ini
WORKDIR /data
VOLUME /data
CMD ["php-fpm"]
app/php.ini
;было error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
;было display_errors = of
display_errors = on
;Разрешить сокращенные теги
;было short_open_tag = of
short_open_tag = on
;было post_max_size = 8M
post_max_size = 200M
;было upload_max_filesize = 2M
upload_max_filesize = 200M
;Если не указать тайм зону, то будут сыпаться ошибки.
;было ;date.timezone =
date.timezone = Asia/Almaty
;заремарить следующую строку, иначе письма будут терять поле FROM
mail.add_x_header = of
daemonize = no
listen = /var/run/php8-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
nginx/mysite.local.conf
server {
listen 80;
server_name mysite.local;
access_log /var/log/nginx/mysite.local.access.log main;
root /data/mysite.local;
index index.php index.html;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php8-fpm.sock;
#fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}