mirror of https://github.com/mpolden/echoip
Add dockerfile
This commit is contained in:
parent
9f839c5f36
commit
da891c9211
|
@ -0,0 +1,35 @@
|
|||
FROM golang:alpine as build-env
|
||||
|
||||
RUN apk --no-cache add git
|
||||
|
||||
RUN go get github.com/mpolden/ipd
|
||||
|
||||
|
||||
FROM alpine as geoipupdate-env
|
||||
|
||||
RUN apk add -q --update alpine-sdk curl-dev file wget zlib-dev git autoconf automake libtool\
|
||||
&& mkdir -p /tmp/geoipupdate && cd /tmp/geoipupdate \
|
||||
&& git clone --depth=1 https://github.com/maxmind/geoipupdate.git . \
|
||||
&& ./bootstrap \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& mkdir -p /tmp/geoip \
|
||||
&& geoipupdate -d /tmp/geoip
|
||||
|
||||
FROM alpine
|
||||
|
||||
MAINTAINER Alessandro Lucaferro <alessandro.lucaferro@gmail.com>
|
||||
|
||||
RUN mkdir ipd
|
||||
|
||||
WORKDIR /ipd
|
||||
|
||||
COPY --from=build-env /go/bin/ipd /ipd/ipd
|
||||
|
||||
COPY --from=geoipupdate-env /tmp/geoip/* /ipd/
|
||||
|
||||
|
||||
ENTRYPOINT ["/ipd/ipd"]
|
||||
|
||||
EXPOSE 8080
|
|
@ -0,0 +1,14 @@
|
|||
# Ipd Docker
|
||||
|
||||
## Build
|
||||
|
||||
docker build -t ipd .
|
||||
|
||||
## Run
|
||||
|
||||
docker run -p 8080:8080 ipd
|
||||
|
||||
|
||||
### Run with GeoIp databases (from docker container)
|
||||
|
||||
docker run -p 8080:8080 ipd -c ./GeoLite2-City.mmdb -f ./GeoLite2-Country.mmdb
|
Loading…
Reference in New Issue