Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

挂在配置文件,为啥会变成目录呢? #499

Open
chahualao opened this issue Jul 5, 2022 · 2 comments
Open

挂在配置文件,为啥会变成目录呢? #499

chahualao opened this issue Jul 5, 2022 · 2 comments

Comments

@chahualao
Copy link

chahualao commented Jul 5, 2022

.env我加入:

HYPERF_IMAGE=hyperf/hyperf:7.4-alpine-v3.11-swoole
HYPERF_PHP_CONF_FILE=./services/hyperf/php.ini
HYPERF_FPM_CONF_FILE=./services/hyperf/php-fpm.conf
HYPERF_LOG_DIR=./logs/hyperf

docker-compose.yml里面加入:
hyperf:
image: ${HYPERF_IMAGE}
container_name: hyperf
tty: true
privileged: true
expose:
- 9601 # http
- 9602 # websocket
volumes:
- ${SOURCE_DIR}:/www/:rw
- ${HYPERF_PHP_CONF_FILE}:/etc/php7/php.ini:ro
- ${HYPERF_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${HYPERF_LOG_DIR}:/var/log/php
working_dir: /www
restart: always
cap_add:
- SYS_PTRACE
networks:
- default

启动后

services文件夹里面 是hyperf/php.ini php.ini是目录,并不是配置文件。
请问这个php.ini应该事先创建么?

@moonshineisme
Copy link

我也是遇到此问题,我装了1个php7.2,然后再安装7.4,env和docker-compose.yml都按照示例来进行配置只是把挂载目录修改了一下,结果生成的php.ini 和php-fpm.conf均变成了目录,而非文件,烦请看看是否为bug?

@moonshineisme
Copy link

env文件内容
PHP_VERSION=7.2.32
PHP_PHP_CONF_FILE=./services/php/php.ini
PHP_FPM_CONF_FILE=./services/php/php-fpm.conf
PHP_LOG_DIR=./logs/php
PHP_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,redis,msgpack

PHP74_VERSION=7.4.30
PHP74_PHP_CONF_FILE=./services/php74/php.ini
PHP74_FPM_CONF_FILE=./services/php74/php-fpm.conf
PHP74_LOG_DIR=./logs/php74
PHP74_EXTENSIONS=zip,pdo_mysql,mysqli,mbstring,gd,curl,opcache,redis,msgpack

docker-compose.yml
php:
build:
context: ./services/php
args:
PHP_VERSION: php:${PHP_VERSION}-fpm-alpine
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP_EXTENSIONS}
TZ: "$TZ"
container_name: php
expose:
- 9501
extra_hosts:
- "www.site1.com:172.17.0.1"
volumes:
- ${SOURCE_DIR}:/www/:rw
- ${PHP_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${PHP_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${PHP_LOG_DIR}:/var/log/php
- ${DATA_DIR}/composer:/tmp/composer
restart: always
cap_add:
- SYS_PTRACE
networks:
- default

php74:
build:
context: ./services/php
args:
PHP_VERSION: php:${PHP74_VERSION}-fpm-alpine
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP74_EXTENSIONS}
TZ: "$TZ"
container_name: php74
expose:
- 9501
extra_hosts:
- "www.site1.com:172.17.0.1"
volumes:
- ${SOURCE_DIR}:/www/:rw
- ${PHP74_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${PHP74_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${PHP74_LOG_DIR}:/var/log/php
- ${DATA_DIR}/composer:/tmp/composer
restart: always
cap_add:
- SYS_PTRACE
networks:
- default

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants