Skip to content

Commit

Permalink
downloading GEOIP DB it's new licensekey
Browse files Browse the repository at this point in the history
  • Loading branch information
Adekunle Ibitayo committed Feb 28, 2020
1 parent bd629dc commit ab36efa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
workspace:
base: /workdir

pipeline:
get_geoip_databases:
image: docker
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
secrets:
- GEOIP_CITY_URL
- GEOIP_COUNTRY_URL
commands:
- apk add curl
- curl -fSL $${GEOIP_CITY_URL} | gzip -d > GeoLite2-City.mmdb
- curl -fSL $${GEOIP_COUNTRY_URL} | gzip -d > GeoLite2-Country.mmdb
when:
event: push

build_and_test_image:
image: quay.io/ukhomeofficedigital/centos-base:latest
environment:
Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ FROM quay.io/ukhomeofficedigital/centos-base:latest
MAINTAINER Lewis Marshall <[email protected]>

WORKDIR /root
RUN mkdir -p /usr/share/GeoIP

COPY ./GeoLite2-City.mmdb /usr/share/GeoIP/GeoLite2-City.mmdb
COPY ./GeoLite2-Country.mmdb /usr/share/GeoIP/GeoLite2-Country.mmdb

ADD ./build.sh /root/
RUN ./build.sh

Expand Down Expand Up @@ -47,4 +52,4 @@ EXPOSE 10080 10443

USER 1000

ENTRYPOINT [ "/go.sh" ]
ENTRYPOINT [ "/go.sh" ]
2 changes: 0 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ mkdir -p ${MAXMIND_PATH}
./configure
make check install
echo "/usr/local/lib" >> /etc/ld.so.conf.d/libmaxminddb.conf
curl -fSL ${GEOIP_COUNTRY_URL} | gzip -d > ${MAXMIND_PATH}/GeoLite2-Country.mmdb
curl -fSL ${GEOIP_CITY_URL} | gzip -d > ${MAXMIND_PATH}/GeoLite2-City.mmdb
chown -R 1000:1000 ${MAXMIND_PATH}
popd

Expand Down

0 comments on commit ab36efa

Please sign in to comment.