docker的yml文件中的环境问题



我写错了:环境:XDEBUG_CONFIG: remote_host=172.17.0.1 remote_port=9000 remote_enable=1网络:——youmas

但我不知道如何修复它们

version: "3"
services:
#PHP
youmas-app:
build:
context: .
dockerfile: Dockerfile
args:
- WITH_XDEBUG=true
image: youmas-app
container_name: youmas-app
restart: unless-stopped
tty: true
environment:
SERVICE_NAME: app
SERVICE_TAGS:
dev
# If you down want to use xDebug, set remote_enable=0
PHP_IDE_CONFIG: "serverName=Docker"
XDEBUG_CONFIG: remote_host=192.168.178.33 remote_port=9001
working_dir: /var/www
volumes:
- ./:/var/www
- ./docker/production/php/local.ini:/usr/local/etc/php/conf.d/local.ini
youmas:
environment:
XDEBUG_CONFIG: remote_host=172.17.0.1 remote_port=9000 remote_enable=1
networks:
- youmas
#Nginx
youmas-webserver:
build:
context: .
dockerfile: "./docker/production/nginx/Dockerfile"
container_name: youmas-webserver
restart: unless-stopped
tty: true
ports:
- "80:80"
- "443:443"
volumes:
- ./:/var/www
- ./docker/production/nginx/conf.d/:/etc/nginx/conf.d/
- ./docker/production/certbot/conf:/etc/letsencrypt
- ./docker/production/certbot/www:/var/www/certbot
networks:
- youmas
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
# Certbot SSL
certbot:
image: certbot/certbot
volumes:
- ./docker/production/certbot/conf:/etc/letsencrypt
- ./docker/production/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"

#MySQL
youmas-database:
image: mysql:5.7.22
container_name: youmas-database
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: youmas
MYSQL_ROOT_PASSWORD: K4@|ahdpof8@@!~
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- dbdata:/var/lib/mysql/
- ./docker/production/mysql/my.cnf:/etc/mysql/my.cnf
networks:
- youmas
#PHP My Admin
youmas-phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- "7000:80"
links:
- youmas-database:youmas-database
environment:
MYSQL_USER: root
MYSQL_PASSWORD: codeverze
MYSQL_ROOT_PASSWORD: codeverze
networks:
- youmas
#Networks
networks:
youmas:
driver: bridge
#Volumes
volumes:
dbdata:
driver: local

解决方案吗?

你的语法错误,将环境部分替换为如下所示:

youmas-app:
build:
context: .
...
...
...
environment:
- 'SERVICE_NAME=app'
- 'SERVICE_TAGS=dev'
...
...

最新更新