From e755161fa7e688a349fbdb4761e237c968fdc8cd Mon Sep 17 00:00:00 2001 From: bewe <93899302+bernarduswillson@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:32:59 +0700 Subject: [PATCH] fix: docker best practice --- .gitignore | 1 + docker-compose.yml | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker-compose.yml b/docker-compose.yml index 215c046..94eff9a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,10 +17,12 @@ services: image: postgres:latest ports: - "5432:5432" + env_file: + - .env environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: bewe - POSTGRES_DB: toco + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_DB: ${DB} volumes: - "./db:/docker-entrypoint-initdb.d" restart: always -- GitLab