From c13de2d0133de1043d929c61d391ac5f8c8e3900 Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Mon, 21 Jan 2019 12:37:11 +0100 Subject: [PATCH] Make sure the env vars are defined before building the prod bundle in Docker. (#2) --- docker-compose.yml | 3 +++ frontend/Dockerfile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 2428555c..a9b007c0 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,6 +43,9 @@ services: - ./shared:/usr/src/app/src/shared:ro - ./shared:/usr/src/shared:ro build: + args: + - GA_ID + - MAPBOX_TOKEN context: . dockerfile: ./frontend/Dockerfile ports: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 839fa380..fccf835b 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,6 +1,9 @@ FROM node:9.11.1 +ARG MAPBOX_TOKEN ENV MAPBOX_TOKEN "$MAPBOX_TOKEN" +ARG GA_ID +ENV GA_ID "$GA_ID" # Set up nginx to proxy requests. # Should probably switch to express since we are in a node container anyway.