Skip to content

A self-hosted solution for providing a web server that provides you back your external IP in json format.

License

Notifications You must be signed in to change notification settings

papamoose/whatsmyip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whats My IP

Self-hosted web app that will return the requestors ip address in json format.

$ curl https://ip.example.com
{"ip":"1.2.3.4"}

Example usage with docker-compose.yml

services:

  redis:
    image: redis:latest
    container_name: redis
    networks:
    - internal
    deploy:
      resources:
        limits:
          memory: 128m

  web:
    #build:
    #  context: .
    #  dockerfile: ./Dockerfile
    image: ghcr.io/papamoose/whatsmyip:latest
    container_name: "whatsmyip"
    hostname: "whatsmyip"
    restart: unless-stopped
    #environment:
      #- PYTHONUNBUFFERED=true
      #- REDIS_HOST=redis
      #- REDIS_PORT=6379
      #- FLASK_ENV=development
      #- FLASK_ENV=production
    networks:
      - internal
      - gateway
    labels:
      - traefik.enable=true
      - traefik.http.routers.whatsmyip.entrypoints=https
      - traefik.http.routers.whatsmyip.rule=Host(`ip.example.com`)
      - traefik.http.routers.whatsmyip.tls.certresolver=le
      - traefik.http.routers.whatsmyip.tls.domains[0].main=ip.example.com
      - traefik.http.services.whatsmyip.loadbalancer.server.port=5000
      # Watchtower autoupdate
      - com.centurylinklabs.watchtower.enable=true


networks:
  internal:
    external: false
  gateway:
    external: true

About

A self-hosted solution for providing a web server that provides you back your external IP in json format.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages