From 7062fd24aac8f0096b28a3ee90f82d3ba2f38c37 Mon Sep 17 00:00:00 2001 From: "kacaii.dev" Date: Fri, 14 Aug 2026 14:22:09 -0300 Subject: [PATCH] docker: maybe its okay to hardcode the values during development --- docker-compose.yaml | 10 +++++----- justfile | 8 +++++++- postgres/init.sql | 10 +++++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index de117ae..3ba9be9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,9 +12,9 @@ services: retries: 5 start_period: 60s environment: - POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: aluno + POSTGRES_PASSWORD: 123 + POSTGRES_DB: senac volumes: ["./postgres:/docker-entrypoint-initdb.d"] # server backend: @@ -31,5 +31,5 @@ services: postgres: condition: service_healthy environment: - DATABASE_URL: ${DATABASE_URL} - SECRET_KEY: ${SECRET_KEY} + DATABASE_URL: postgres://aluno:123@postgres:5432/senac + SECRET_KEY: senac diff --git a/justfile b/justfile index 0c0c222..739cdea 100644 --- a/justfile +++ b/justfile @@ -29,4 +29,10 @@ down: docker compose down -v run-database: - podman compose run postgres + podman run -d --name server_database \ + -e POSTGRES_USER="aluno" \ + -e POSTGRES_PASSWORD="123" \ + -e POSTGRES_DB="senac" \ + -p "5432:5432" \ + docker.io/postgres:18-alpine + diff --git a/postgres/init.sql b/postgres/init.sql index 8b13789..454e2b5 100644 --- a/postgres/init.sql +++ b/postgres/init.sql @@ -1 +1,9 @@ - +CREATE TABLE account ( + id uuid DEFAULT uuidv7(), + full_name text NOT NULL, + password_hash text NOT NULL, + email text UNIQUE NOT NULL CHECK (email LIKE '%@%'), + created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (id) +); -- 2.54.0