diff --git a/scripts/run_docker.sh b/scripts/run_docker.sh index cc66dde86..45269acd0 100755 --- a/scripts/run_docker.sh +++ b/scripts/run_docker.sh @@ -8,6 +8,27 @@ if [[ $(git rev-parse --show-toplevel) != $(pwd) ]]; then exit 1; fi +if [[ ! -f .env ]]; then + ( + cd web/backend + npm ci + cat < ../../.env +DELA_PROXY_URL=http://172.19.44.254:8080 +DATABASE_USERNAME=dvoting +DATABASE_PASSWORD=$RANDOM # choose any PostgreSQL password +DATABASE_HOST=db +DATABASE_PORT=5432 +DB_PATH=dvoting # LMDB database path +FRONT_END_URL=http://127.0.0.1:3000 # the automated frontend tests expect this value do not change it +BACKEND_HOST=backend +BACKEND_PORT=5000 +SESSION_SECRET=$RANDOM # choose any secret +PROXYPORT=8080 +NODEPORT=2000 # DELA node port +$( npm run keygen | tail -n 2 ) +EOF + ) +fi source ./.env; export COMPOSE_FILE=${COMPOSE_FILE:-./docker-compose/docker-compose.yml};