如何从docker容器(web
)访问主机端口?
我的docker-compose.yml
文件:
version: '3'
services:
db:
image: postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
web:
build: .
command: python server.py
volumes:
- .:/code
ports:
- 5000:5000
depends_on:
- db