From ed77cab7009ae659cc3b12b1e2c091099b8be088 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 27 May 2025 20:55:53 +0000 Subject: [PATCH] Environment and docker changes (#37) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/37 Co-authored-by: phoenix Co-committed-by: phoenix --- .env.docker.sample | 6 ++++++ .env.sample | 10 +++++----- .gitignore | 1 - docker-compose.yaml | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 .env.docker.sample diff --git a/.env.docker.sample b/.env.docker.sample new file mode 100644 index 0000000..5c0ad33 --- /dev/null +++ b/.env.docker.sample @@ -0,0 +1,6 @@ +SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h +POSTGRES_AUTH_USER=icarus_op +POSTGRES_AUTH_PASSWORD=password +POSTGRES_AUTH_DB=icarus_auth_db +POSTGRES_AUTH_HOST=auth_db +DATABASE_URL=postgresql://${POSTGRES_AUTH_USER}:${POSTGRES_AUTH_PASSWORD}@${POSTGRES_AUTH_HOST}:5432/${POSTGRES_AUTH_DB} diff --git a/.env.sample b/.env.sample index 30ccbb4..b556c08 100644 --- a/.env.sample +++ b/.env.sample @@ -1,6 +1,6 @@ SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h -POSTGRES_USER=icarus_op_test -POSTGRES_PASSWORD=password -POSTGRES_DB=icarus_auth_test_db -POSTGRES_HOST=localhost -DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB} \ No newline at end of file +POSTGRES_AUTH_USER=icarus_op_test +POSTGRES_AUTH_PASSWORD=password +POSTGRES_AUTH_DB=icarus_auth_test_db +POSTGRES_AUTH_HOST=localhost +DATABASE_URL=postgresql://${POSTGRES_AUTH_USER}:${POSTGRES_AUTH_PASSWORD}@${POSTGRES_AUTH_HOST}:5432/${POSTGRES_AUTH_DB} diff --git a/.gitignore b/.gitignore index 7394036..e551aa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /target Cargo.lock .env -.env.docker diff --git a/docker-compose.yaml b/docker-compose.yaml index ed72c2b..c87e8d9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -23,9 +23,9 @@ services: container_name: icarus_auth_db # Optional: Give the container a specific name environment: # These MUST match the user, password, and database name in the DATABASE_URL above - POSTGRES_USER: ${POSTGRES_USER:-icarus_op} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} - POSTGRES_DB: ${POSTGRES_DB:-icarus_auth} + POSTGRES_USER: ${POSTGRES_AUTH_USER:-icarus_op} + POSTGRES_PASSWORD: ${POSTGRES_AUTH_PASSWORD:-password} + POSTGRES_DB: ${POSTGRES_AUTH_DB:-icarus_auth_db} volumes: # Persist database data using a named volume - postgres_data:/var/lib/postgresql/data