Skip to content

Commit 824f9a9

Browse files
committed
Update Makefile to create an .env file
- Updates our Makefile with a new target to create an empty .env file if one does not already exist. If one already exists it won't be altered. - Updates the `web:` target to use the .env file when starting the container.
1 parent 0593e12 commit 824f9a9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dev/local/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ LOG_REDIS:=delphi_redis_instance_$(NOW).log
7777
WEB_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_web_epidata')
7878
DATABASE_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_database_epidata')
7979
REDIS_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_redis')
80+
ENV_FILE:=repos/delphi/delphi-epidata/.env
8081

8182
M1=
8283
ifeq ($(shell uname -smp), Darwin arm64 arm)
@@ -106,6 +107,7 @@ web:
106107
@# see https://github.com/tiangolo/meinheld-gunicorn-docker#module_name
107108
@docker run --rm -p 127.0.0.1:10080:80 \
108109
$(M1) \
110+
--env-file $(ENV_FILE) \
109111
--env "MODULE_NAME=delphi.epidata.server.main" \
110112
--env "SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri)" \
111113
--env "FLASK_SECRET=abc" --env "FLASK_PREFIX=/epidata" --env "LOG_DEBUG" \
@@ -170,7 +172,7 @@ redis:
170172
--name delphi_redis delphi_redis >$(LOG_REDIS) 2>&1 &
171173

172174
.PHONY=all
173-
all: db web py redis
175+
all: env db web py redis
174176

175177
.PHONY=test
176178
test:
@@ -211,3 +213,7 @@ sql:
211213
.PHONY=clean
212214
clean:
213215
@docker images -f "dangling=true" -q | xargs docker rmi >/dev/null 2>&1
216+
217+
.PHONY=env
218+
env:
219+
@touch $(ENV_FILE)

0 commit comments

Comments
 (0)