Skip to content

Commit 4f022d3

Browse files
committed
add freegeoip
1 parent 7f2e3e9 commit 4f022d3

File tree

5 files changed

+75
-1
lines changed

5 files changed

+75
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ A collection of delicious docker recipes.
2121
- [ ] caddy
2222
- [ ] dsniff
2323
- [ ] ettercap
24-
- [ ] freegeoip
2524
- [ ] freelan
2625
- [ ] gitbook
2726
- [ ] gitolite
@@ -76,6 +75,7 @@ A collection of delicious docker recipes.
7675
- [x] cadvisor
7776
- [x] casperjs :+1:
7877
- [x] collectd
78+
- [x] freegeoip
7979
- [x] freeradius
8080
- [x] frp :cn:
8181
- [x] graphite

freegeoip/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# Dockerfile for freegeoip
3+
#
4+
5+
FROM alpine
6+
MAINTAINER EasyPi Software Foundation
7+
8+
ENV FREEGEOIP_VERSION 3.4.1
9+
ENV FREEGEOIP_FILE freegeoip-${FREEGEOIP_VERSION}-linux-amd64.tar.gz
10+
ENV FREEGEOIP_URL https://github.com/fiorix/freegeoip/releases/download/v${FREEGEOIP_VERSION}/${FREEGEOIP_FILE}
11+
12+
WORKDIR /opt/freegeoip
13+
14+
RUN set -xe \
15+
&& apk add --no-cache curl tar \
16+
&& curl -sSL ${FREEGEOIP_URL} | tar xz --strip 1 \
17+
&& apk del curl tar
18+
19+
EXPOSE 8080 8888
20+
21+
ENTRYPOINT ["./freegeoip"]
22+
CMD ["-public", "public", "-http", ":8080", "-internal-server", ":8888"]

freegeoip/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
freegeoip
2+
=========
3+
4+
## docker-compose.yml
5+
6+
```yaml
7+
freegeoip:
8+
image: vimagick/freegeoip
9+
ports:
10+
- "8080:8080"
11+
- "8888:8888"
12+
restart: always
13+
```
14+
15+
## up and running
16+
17+
```bash
18+
$ docker-compose up -d
19+
20+
$ curl -s http://localhost:8080/json/8.8.8.8 | jq .
21+
{
22+
"ip": "8.8.8.8",
23+
"country_code": "US",
24+
"country_name": "United States",
25+
"region_code": "",
26+
"region_name": "",
27+
"city": "",
28+
"zip_code": "",
29+
"time_zone": "",
30+
"latitude": 37.751,
31+
"longitude": -97.822,
32+
"metro_code": 0
33+
}
34+
```

freegeoip/docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
freegeoip:
2+
image: vimagick/freegeoip
3+
ports:
4+
- "8080:8080"
5+
- "8888:8888"
6+
restart: always

freegeoip/freegeoip.service

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=IP Geolocation Web Server
3+
After=network-online.target
4+
5+
[Service]
6+
WorkingDirectory=/opt/freegeoip
7+
ExecStart=/opt/freegeoip/freegeoip -public public -http :8080 -internal-server :8888
8+
Restart=always
9+
RestartSec=5
10+
11+
[Install]
12+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)