shinebayar-g / ufw-docker-automated

Manage docker containers firewall with UFW!
Apache License 2.0
198 stars 31 forks source link

ufw-docker-automated in docker-compose #1

Closed vedrancek closed 4 years ago

vedrancek commented 4 years ago

Hello,

this not an issue report but a question. How to implement your feature with docker compose?

Cheers!

shinebayar-g commented 4 years ago

Hi @vedrancek , thanks for checking out my project. It should work with following sample. But it's not working. I'll dig further the issue and will give feedback.

version: "2.1"
services:
  nginx:
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "127.0.0.1:8080:80"
    labels:
        UFW_MANAGED: "TRUE"
    networks:
      - my-net

networks:
  my-net:
    driver: bridge
vedrancek commented 4 years ago

Hi @shinebayar-g, thanks for the reply. It would be great if it would work from docker-compose.

Cheers!

shinebayar-g commented 4 years ago

Hi @vedrancek , I've improved the code and now it supports docker-compose network. I've added example code in an examples folder as well. Let me know if it works for you?