Docker Compose: Use internal networks between containers

This commit is contained in:
Igor Scheller 2020-10-17 15:41:58 +02:00 committed by msquare
parent dbf3737170
commit a443373a50
2 changed files with 18 additions and 7 deletions

View File

@ -11,7 +11,8 @@ services:
ports: ports:
- 5000:80 - 5000:80
networks: networks:
- internal - fpm
- internet
depends_on: depends_on:
- es_php_fpm - es_php_fpm
es_php_fpm: es_php_fpm:
@ -33,8 +34,9 @@ services:
MAIL_DRIVER: log MAIL_DRIVER: log
APP_NAME: Engelsystem DEV APP_NAME: Engelsystem DEV
networks: networks:
- internal
- database - database
- fpm
- internet
depends_on: depends_on:
- es_database - es_database
es_workspace: es_workspace:
@ -56,8 +58,9 @@ services:
MAIL_DRIVER: log MAIL_DRIVER: log
APP_NAME: Engelsystem DEV APP_NAME: Engelsystem DEV
networks: networks:
- internal
- database - database
- fpm
- internet
depends_on: depends_on:
- es_database - es_database
es_database: es_database:
@ -76,5 +79,8 @@ volumes:
db: {} db: {}
networks: networks:
internal:
database: database:
internal: true
fpm:
internal: true
internet:

View File

@ -8,7 +8,8 @@ services:
ports: ports:
- 5000:80 - 5000:80
networks: networks:
- internal - fpm
- internet
depends_on: depends_on:
- es_php_fpm - es_php_fpm
es_php_fpm: es_php_fpm:
@ -22,8 +23,9 @@ services:
MYSQL_PASSWORD: engelsystem MYSQL_PASSWORD: engelsystem
MYSQL_DATABASE: engelsystem MYSQL_DATABASE: engelsystem
networks: networks:
- internal
- database - database
- fpm
- internet
depends_on: depends_on:
- es_database - es_database
es_database: es_database:
@ -42,5 +44,8 @@ volumes:
db: {} db: {}
networks: networks:
internal:
database: database:
internal: true
fpm:
internal: true
internet: