commit 2066dc834ebee17b827b211a226c314a29bd38d9 Author: dhanush.s Date: Thu Sep 4 19:30:12 2025 +0530 feat: postgres docker compose diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c9cd39 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.env +.venv +frontend \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cf1828c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "backend"] + path = backend + url = git@git.opsmonsters.in:opsmonsters/lolita-backend.git diff --git a/backend b/backend new file mode 160000 index 0000000..df20ceb --- /dev/null +++ b/backend @@ -0,0 +1 @@ +Subproject commit df20ceb45125c259dac552807f2cd08db44cf0e7 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..33f14f4 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,18 @@ +services: + postgres: + image: postgres:15 + container_name: my_postgres + restart: unless-stopped + ports: + - "${POSTGRES_PORT}:5432" + environment: + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: ${POSTGRES_DB} + volumes: + - postgres_data:/var/lib/postgresql/data + - ./init.sql:/docker-entrypoint-initdb.d/init.sql + +volumes: + postgres_data: + diff --git a/init.sql b/init.sql new file mode 100644 index 0000000..47f834a --- /dev/null +++ b/init.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS users ( + id SERIAL PRIMARY KEY, + email VARCHAR(255) UNIQUE NOT NULL, + hashed_password VARCHAR(255) NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS otps ( + id SERIAL PRIMARY KEY, + email VARCHAR(255) NOT NULL, + otp VARCHAR(6) NOT NULL, + created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP +);