1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-28 09:08:50 +02:00

add freegeoip

This commit is contained in:
kev 2018-11-28 14:05:02 +08:00
parent 7f2e3e9316
commit 4f022d31e0
5 changed files with 75 additions and 1 deletions

View File

@ -21,7 +21,6 @@ A collection of delicious docker recipes.
- [ ] caddy
- [ ] dsniff
- [ ] ettercap
- [ ] freegeoip
- [ ] freelan
- [ ] gitbook
- [ ] gitolite
@ -76,6 +75,7 @@ A collection of delicious docker recipes.
- [x] cadvisor
- [x] casperjs :+1:
- [x] collectd
- [x] freegeoip
- [x] freeradius
- [x] frp :cn:
- [x] graphite

22
freegeoip/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
#
# Dockerfile for freegeoip
#
FROM alpine
MAINTAINER EasyPi Software Foundation
ENV FREEGEOIP_VERSION 3.4.1
ENV FREEGEOIP_FILE freegeoip-${FREEGEOIP_VERSION}-linux-amd64.tar.gz
ENV FREEGEOIP_URL https://github.com/fiorix/freegeoip/releases/download/v${FREEGEOIP_VERSION}/${FREEGEOIP_FILE}
WORKDIR /opt/freegeoip
RUN set -xe \
&& apk add --no-cache curl tar \
&& curl -sSL ${FREEGEOIP_URL} | tar xz --strip 1 \
&& apk del curl tar
EXPOSE 8080 8888
ENTRYPOINT ["./freegeoip"]
CMD ["-public", "public", "-http", ":8080", "-internal-server", ":8888"]

34
freegeoip/README.md Normal file
View File

@ -0,0 +1,34 @@
freegeoip
=========
## docker-compose.yml
```yaml
freegeoip:
image: vimagick/freegeoip
ports:
- "8080:8080"
- "8888:8888"
restart: always
```
## up and running
```bash
$ docker-compose up -d
$ curl -s http://localhost:8080/json/8.8.8.8 | jq .
{
"ip": "8.8.8.8",
"country_code": "US",
"country_name": "United States",
"region_code": "",
"region_name": "",
"city": "",
"zip_code": "",
"time_zone": "",
"latitude": 37.751,
"longitude": -97.822,
"metro_code": 0
}
```

View File

@ -0,0 +1,6 @@
freegeoip:
image: vimagick/freegeoip
ports:
- "8080:8080"
- "8888:8888"
restart: always

View File

@ -0,0 +1,12 @@
[Unit]
Description=IP Geolocation Web Server
After=network-online.target
[Service]
WorkingDirectory=/opt/freegeoip
ExecStart=/opt/freegeoip/freegeoip -public public -http :8080 -internal-server :8888
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target