From 0e8b7b06522c70ef30033c2ecc5a16f317ec6f45 Mon Sep 17 00:00:00 2001 From: Ben Rometsch Date: Mon, 1 Jun 2020 11:05:58 +0100 Subject: [PATCH] Docker prod builds now can take environment varaibles Docker prod builds now can take environment varaibles --- Dockerfile | 4 +--- bin/docker/run-docker.sh | 3 +++ docker-compose.production.yml | 5 ++--- docker-compose.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100755 bin/docker/run-docker.sh diff --git a/Dockerfile b/Dockerfile index d2381dc0..862055db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,6 @@ COPY --from=development --chown=root:root /srv/bt/node_modules ./node_modules COPY . . ENV ENV prod -RUN npm run env -RUN npm run bundle EXPOSE 8080 -CMD [ "npm", "run", "start" ] +CMD [ "./bin/docker/run-docker.sh" ] diff --git a/bin/docker/run-docker.sh b/bin/docker/run-docker.sh new file mode 100755 index 00000000..db22b226 --- /dev/null +++ b/bin/docker/run-docker.sh @@ -0,0 +1,3 @@ +npm run env +npm run bundle +npm run start \ No newline at end of file diff --git a/docker-compose.production.yml b/docker-compose.production.yml index f214a66b..8749e45c 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -4,14 +4,13 @@ services: bullettrain: build: context: . - command: npm run start environment: - API_URL=http://localhost:8000/api/v1/ - ASSET_URL=http://localhost:8080/ ports: - '8080:8080' volumes: - - chat_node_modules:/srv/chat/node_modules + - bt_node_modules:/srv/bt/node_modules volumes: - chat_node_modules: + bt_node_modules: diff --git a/docker-compose.yml b/docker-compose.yml index a99c3bd1..1ca5a031 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: . target: development - dockerfile: Dockerfile.dev + dockerfile: Dockerfile command: npm run dev environment: - API_URL=http://localhost:8000/api/v1/