From 42c2cead2c7cf03ef1338da2455d645387614085 Mon Sep 17 00:00:00 2001 From: exilvm Date: Sat, 15 Apr 2023 12:34:36 +0000 Subject: [PATCH] Fix `./setup.sh --docker` by preventing `NODE_ENV` from defaulting to `production` during the Docker build process --- Dockerfile | 4 ++++ setup.sh | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f802a7c4d0..f60505bdea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # Use the official Node.js image as the base image FROM node:19-alpine +ARG NODE_ENV + +ENV NODE_ENV=$NODE_ENV + # Set the working directory WORKDIR /app diff --git a/setup.sh b/setup.sh index 931e08bc73..a9b5a99da8 100644 --- a/setup.sh +++ b/setup.sh @@ -16,7 +16,8 @@ printf $ENV > .env if [ "$1" = "--docker" ]; then printf $ENV > .env.docker - docker build -t agentgpt . + source .env.docker + docker build --build-arg NODE_ENV=$NODE_ENV -t agentgpt . docker run -d --name agentgpt -p 3000:3000 -v $(pwd)/db:/app/db agentgpt else printf $ENV > .env