diff --git a/.gitignore b/.gitignore index 02ced5fd..91952b07 100755 --- a/.gitignore +++ b/.gitignore @@ -641,6 +641,9 @@ FodyWeavers.xsd # Celery django +# Postgres +db + # robosats frontend/static/assets/avatars* api/lightning/lightning* diff --git a/docker-compose.yml b/docker-compose.yml index 488d30a1..f6235567 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -115,6 +115,16 @@ services: - /mnt/development/tor/data:/var/lib/tor:ro - /mnt/development/tor/config:/etc/tor:ro - /mnt/development/bitcoin:/home/bitcoin/.bitcoin + + postgres: + image: postgres:14.2-alpine + container_name: sql-dev + restart: always + environment: + POSTGRES_PASSWORD: example + network_mode: service:tor + volumes: + - ./db:/var/lib/postgresql/data volumes: redisdata: \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index a1bc7274..6916969d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,3 +21,5 @@ ring==0.9.1 robohash==1.1 scipy==1.8.0 gunicorn==20.1.0 +psycopg2==2.9.3 +SQLAlchemy==1.4.31 \ No newline at end of file diff --git a/robosats/settings.py b/robosats/settings.py index 57ff0eae..525d79ee 100644 --- a/robosats/settings.py +++ b/robosats/settings.py @@ -97,11 +97,12 @@ WSGI_APPLICATION = "robosats.wsgi.application" DATABASES = { "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": "/usr/src/database/db.sqlite3", - "OPTIONS": { - "timeout": 20, # in seconds - }, + "ENGINE": "django.db.backends.postgresql", + "NAME": "postgres", + "USER": "postgres", + "PASSWORD": "example", + 'HOST': '127.0.0.1', + "PORT": "5432", } }