mpolden / echoip

IP address lookup service
https://ifconfig.co
BSD 3-Clause "New" or "Revised" License
4.01k stars 526 forks source link

Docker compose file #158

Open ShlomiPorush opened 2 years ago

ShlomiPorush commented 2 years ago

After I saw that there was no documentation how to run it in docker compose.. So, Enjoy.

version: '3.7'

services:
  echoip:
    image: mpolden/echoip
    command: "-C 0 -p -r -H X-Forwarded-For -a /data/GeoLite2-ASN.mmdb -c /data/GeoLite2-City.mmdb -f /data/GeoLite2-Country.mmdb"
    ports:
      - 8080:8080
    volumes:
      - ./data:/data:ro

  # this container needs to runs only once or whan you want to update Geo databases
  maxmind:
    image: maxmindinc/geoipupdate
    environment:
      - GEOIPUPDATE_ACCOUNT_ID= # get your own account from https://www.maxmind.com/
      - GEOIPUPDATE_LICENSE_KEY= # get your own key from https://www.maxmind.com/
      - GEOIPUPDATE_EDITION_IDS=GeoLite2-ASN GeoLite2-City GeoLite2-Country
    volumes:
      - ./data:/usr/share/GeoIP
mqu commented 2 years ago

I have an issue with reverse-proxy and "Host" value behind apache. Header page should display some thing like this: ifconfig.my.domain — What is my IP address? but is displaying "localhost:<port> — What is my IP address?"

I am running echoip with : entrypoint: /opt/echoip/echoip -H X-Forwarded-For and this apache reverse-proxy configuration.

<VirtualHost *:443>
        ServerName ifconfig.my.domain
        ...
    ProxyPass        / http://localhost:8931/ 
        ProxyPassReverse / http://localhost:8931/
        RemoteIPHeader X-Forwarded-For
        ...
</VirtualHost>
mqu commented 2 years ago

fixed : need to add : "ProxyPreserveHost On", in Apache reverse-proxy configuration. thanks.

afzl-wtu commented 2 years ago

-C 0 -p -r -H X-Forwarded-For -a /data/GeoLite2-ASN.mmdb -c /data/GeoLite2-City.mmdb -f /data/GeoLite2-Country.mmdb

No matter what I do: My compose file: image

But I always get this:

image

afzl-wtu commented 2 years ago

After I saw that there was no documentation how to run it in docker compose.. So, Enjoy.

version: '3.7'

services:
  echoip:
    image: mpolden/echoip
    command: "-C 0 -p -r -H X-Forwarded-For -a /data/GeoLite2-ASN.mmdb -c /data/GeoLite2-City.mmdb -f /data/GeoLite2-Country.mmdb"
    ports:
      - 8080:8080
    volumes:
      - ./data:/data:ro

  # this container needs to runs only once or whan you want to update Geo databases
  maxmind:
    image: maxmindinc/geoipupdate
    environment:
      - GEOIPUPDATE_ACCOUNT_ID= # get your own account from https://www.maxmind.com/
      - GEOIPUPDATE_LICENSE_KEY= # get your own key from https://www.maxmind.com/
      - GEOIPUPDATE_EDITION_IDS=GeoLite2-ASN GeoLite2-City GeoLite2-Country
    volumes:
      - ./data:/usr/share/GeoIP

https://github.com/mpolden/echoip/issues/159

afzl-wtu commented 1 year ago

After I saw that there was no documentation how to run it in docker compose.. So, Enjoy.

version: '3.7'

services:
  echoip:
    image: mpolden/echoip
    command: "-C 0 -p -r -H X-Forwarded-For -a /data/GeoLite2-ASN.mmdb -c /data/GeoLite2-City.mmdb -f /data/GeoLite2-Country.mmdb"
    ports:
      - 8080:8080
    volumes:
      - ./data:/data:ro

  # this container needs to runs only once or whan you want to update Geo databases
  maxmind:
    image: maxmindinc/geoipupdate
    environment:
      - GEOIPUPDATE_ACCOUNT_ID= # get your own account from https://www.maxmind.com/
      - GEOIPUPDATE_LICENSE_KEY= # get your own key from https://www.maxmind.com/
      - GEOIPUPDATE_EDITION_IDS=GeoLite2-ASN GeoLite2-City GeoLite2-Country
    volumes:
      - ./data:/usr/share/GeoIP

LOL Helped me again. I forgot all about it. AFter one year