1 回答

TA貢獻1829條經驗 獲得超9個贊
使用將您的所有服務連接在一起networks
碼頭工人-compose.yml
version: "3.3"
services:
nougat: #Nginx Server
image: tutum/nginx:latest
ports:
- "8080:80"
networks: # <-- Add this line
- random_name # <-- Add this line
# links: # <-- Remove this
# - papaya # <-- Remove this
volumes:
- type: bind
source: ./nginx
target: /etc/nginx/sites-available
- type: bind
source: ./nginx
target: /etc/nginx/sites-enabled
- type: bind
source: ./logs/nginx-error.log
target: /var/log/nginx/error.log
- type: bind
source: ./logs/nginx-access.log
target: /var/log/nginx/access.log
papaya: # PHP-FPM service
build: .
networks: # <-- Add this line
- random_name # <-- Add this line
volumes:
- type: bind
source: ./public
target: /usr/share/nginx/html
mango: # MariaDB database
image: mariadb:10.5.1
networks: # <-- Add this line
- random_name # <-- Add this line
volumes:
- type: bind
source: ./mango_database
target: /var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: admin
pomegranate: # phpMyAdmin web-service
image: phpmyadmin/phpmyadmin:4.9.4
restart: always
# links: # <-- Remove this
# - mango:mysql # <-- Remove this
ports:
- "8081:80"
networks: # <-- Add this line
- random_name # <-- Add this line
environment:
PMA_HOST: mysql
PMA_USER: root
PMA_PASSWORD: admin
PMA_ARBITRARY: 1
networks: # <-- Add this line
random-name: # <-- Add this line
- 1 回答
- 0 關注
- 165 瀏覽
添加回答
舉報