docker-compose.yml
version: '2'
services:
whoami:
image: jwilder/whoami
container_name: whoami
networks:
- no-internet
proxy:
image: nginx:1.13-alpine
container_name: proxy
networks:
- no-internet
volumes:
- ./vhost.conf:/etc/nginx/conf.d/default.conf
ports:
- "8091:80"
depends_on:
- whoami
networks:
no-internet:
external: true
name: no-internet
server {
server_name localhost;
listen 80;
location / {
proxy_pass http://whoami:8000;
}
}
I attach proxy container and execute two commands, which result that ping whoami worked while nc to whoami:8000 or wget http://whoami:8000 not working
I check the service of whoami as well, this shows that the http service is working properly




