Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG GEOIP-API
===================

Unreleased
----------

* Respect optional `PORT` environment variable for the HTTP listen port
(defaults to `8080`), for platforms such as Dokku.

2023-01 (2022-12-31)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ COPY --from=builder "/build/GeoLite2-ASN.mmdb" /srv/GeoLite2-ASN.mmdb

ENV CITY_DB_FILE /srv/GeoLite2-City.mmdb
ENV ASN_DB_FILE /srv/GeoLite2-ASN.mmdb
HEALTHCHECK --interval=5s --timeout=1s CMD curl -f http://localhost:8080/actuator/health
HEALTHCHECK --interval=5s --timeout=1s CMD curl -f http://localhost:${PORT:-8080}/actuator/health
EXPOSE 8080
CMD exec /srv/geoip-api
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ variables:

| Variable | Description | Default value |
| -------- | ----------- | ------------- |
| PORT | HTTP port the service listens on (used by platforms such as Dokku). | `8080` |
| CITY_DB_FILE | The location of the GeoIP2 City or GeoLite2 database file. | `/srv/GeoLite2-City.mmdb` |
| ASN_DB_FILE | The location of the GeoIP2 ASN database file. | `/srv/GeoLite2-ASN.mmdb` |
| ISP_DB_FILE | The location of the GeoIP2 ISP database file. | (none) |
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
spring.main.banner-mode: "off"
management.endpoints.web.exposure.include: health, prometheus

# Honor PORT when set by platforms such as Dokku/Heroku; default to 8080.
server.port: ${PORT:8080}