From 05b9b384bfe5e19beaf0340fa4fefd1abb0c556e Mon Sep 17 00:00:00 2001 From: R-enanVieira Date: Fri, 13 Dec 2024 14:29:18 -0300 Subject: [PATCH] :bricks: ci: add container with postgres databe --- .env.template | 3 +++ .gitignore | 3 ++- docker-compose.yml | 14 ++++++++++++++ makefile | 14 ++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .env.template create mode 100644 docker-compose.yml create mode 100644 makefile diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..a193e0e --- /dev/null +++ b/.env.template @@ -0,0 +1,3 @@ +POSTGRES_USER=postgres +POSTGRES_PASSWORD=123456 +POSTGRES_DB=postgres diff --git a/.gitignore b/.gitignore index a979ee7..2f7cdab 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/venv \ No newline at end of file +/venv +.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..21c209c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +services: + postgres: + image: postgres:latest + container_name: unimancer_postgres + environment: + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: ${POSTGRES_DB} + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data +volumes: + postgres_data: diff --git a/makefile b/makefile new file mode 100644 index 0000000..589e42a --- /dev/null +++ b/makefile @@ -0,0 +1,14 @@ +config: + @cp .env.template .env + +build: + @sudo docker compose up --build + +start: + @sudo docker compose up + +stop: + @sudo docker compose down + +rmv: + @sudo docker compose down -v