HomePhabricator
Diffusion Comm a9b9d0516933

[keyserver] Move update-geoip to an earlier step in Docker build

Description

[keyserver] Move update-geoip to an earlier step in Docker build

Summary:
The update-geoip script updates our GeoIP database during the Docker build to make sure that it is current. The GeoIP database is otherwise dated as of the last publish of the geoip-lite NPM package that we use.

The goal of this diff is to make it easier for me to iterate on code in the production Docker environment. Right now, because the update-geoip happens after the COPY . . step, it gets re-run after any change, which means I have to wait ~15 minutes to test any change.

In this diff, we move the update-geoip step earlier. But because that necessitates moving it before any Babel transpilation, we can no longer use our own update-geoip script. That script (which is deleted here) basically just strings together a getCommConfig call with a call to the underlying update-geoip script we get from the geoip-lite package.

So this diff ultimately does three things:

  1. Replaces the existing update-geoip script with a new one that only supports the Docker environment, but doesn't require any Babel transpilation
  2. Makes it so the update-geoip script is only called in the Docker environment
  3. Moves the update-geoip script invocation to an earlier step in the Docker build

I think it's fine that update-geoip only supports the Docker environment going forward. It takes a long time and isn't useful for the dev environment.

Test Plan: Ran the Docker build locally, both with and without the GeoIP license key being set in keyserver/.env

Reviewers: atul, jon

Reviewed By: jon

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D7370

Details

Provenance
ashoatAuthored on Apr 9 2023, 7:30 AM
Reviewer
jon
Differential Revision
D7370: [keyserver] Move update-geoip to an earlier step in Docker build
Parents
rCOMMafba840f9fb3: [native] Added edit button to the Tooltip
Branches
Unknown
Tags
Unknown