Commit e3103b1c authored by erdnaxe's avatar erdnaxe 🎇

Switch to postgressql

parent ffff5224
...@@ -22,3 +22,5 @@ yarn-error.log* ...@@ -22,3 +22,5 @@ yarn-error.log*
# database # database
*.sqlite3 *.sqlite3
# private
.env
...@@ -9,6 +9,7 @@ djangorestframework = "*" ...@@ -9,6 +9,7 @@ djangorestframework = "*"
django-rest-swagger = "*" django-rest-swagger = "*"
django-rest-auth = "*" django-rest-auth = "*"
django-allauth = "*" django-allauth = "*"
"psycopg2" = "*"
[dev-packages] [dev-packages]
......
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "a6e73162f77e329da68523a3724c045fd853c4986653fdcc88a6434e1ca3f1ae" "sha256": "73076a0aa34cd211aac51b0787d1ce6a6baec3a2216320ffda2c682baf0b9d77"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
...@@ -128,6 +128,42 @@ ...@@ -128,6 +128,42 @@
], ],
"version": "==1.3.2" "version": "==1.3.2"
}, },
"psycopg2": {
"hashes": [
"sha256:0b9e48a1c1505699a64ac58815ca99104aacace8321e455072cee4f7fe7b2698",
"sha256:0f4c784e1b5a320efb434c66a50b8dd7e30a7dc047e8f45c0a8d2694bfe72781",
"sha256:0fdbaa32c9eb09ef09d425dc154628fca6fa69d2f7c1a33f889abb7e0efb3909",
"sha256:11fbf688d5c953c0a5ba625cc42dea9aeb2321942c7c5ed9341a68f865dc8cb1",
"sha256:19eaac4eb25ab078bd0f28304a0cb08702d120caadfe76bb1e6846ed1f68635e",
"sha256:3232ec1a3bf4dba97fbf9b03ce12e4b6c1d01ea3c85773903a67ced725728232",
"sha256:36f8f9c216fcca048006f6dd60e4d3e6f406afde26cfb99e063f137070139eaf",
"sha256:59c1a0e4f9abe970062ed35d0720935197800a7ef7a62b3a9e3a70588d9ca40b",
"sha256:6506c5ff88750948c28d41852c09c5d2a49f51f28c6d90cbf1b6808e18c64e88",
"sha256:6bc3e68ee16f571681b8c0b6d5c0a77bef3c589012352b3f0cf5520e674e9d01",
"sha256:6dbbd7aabbc861eec6b910522534894d9dbb507d5819bc982032c3ea2e974f51",
"sha256:6e737915de826650d1a5f7ff4ac6cf888a26f021a647390ca7bafdba0e85462b",
"sha256:6ed9b2cfe85abc720e8943c1808eeffd41daa73e18b7c1e1a228b0b91f768ccc",
"sha256:711ec617ba453fdfc66616db2520db3a6d9a891e3bf62ef9aba4c95bb4e61230",
"sha256:844dacdf7530c5c612718cf12bc001f59b2d9329d35b495f1ff25045161aa6af",
"sha256:86b52e146da13c896e50c5a3341a9448151f1092b1a4153e425d1e8b62fec508",
"sha256:985c06c2a0f227131733ae58d6a541a5bc8b665e7305494782bebdb74202b793",
"sha256:a86dfe45f4f9c55b1a2312ff20a59b30da8d39c0e8821d00018372a2a177098f",
"sha256:aa3cd07f7f7e3183b63d48300666f920828a9dbd7d7ec53d450df2c4953687a9",
"sha256:b1964ed645ef8317806d615d9ff006c0dadc09dfc54b99ae67f9ba7a1ec9d5d2",
"sha256:b2abbff9e4141484bb89b96eb8eae186d77bc6d5ffbec6b01783ee5c3c467351",
"sha256:cc33c3a90492e21713260095f02b12bee02b8d1f2c03a221d763ce04fa90e2e9",
"sha256:d7de3bf0986d777807611c36e809b77a13bf1888f5c8db0ebf24b47a52d10726",
"sha256:db5e3c52576cc5b93a959a03ccc3b02cb8f0af1fbbdc80645f7a215f0b864f3a",
"sha256:e168aa795ffbb11379c942cf95bf813c7db9aa55538eb61de8c6815e092416f5",
"sha256:e9ca911f8e2d3117e5241d5fa9aaa991cb22fb0792627eeada47425d706b5ec8",
"sha256:eccf962d41ca46e6326b97c8fe0a6687b58dfc1a5f6540ed071ff1474cea749e",
"sha256:efa19deae6b9e504a74347fe5e25c2cb9343766c489c2ae921b05f37338b18d1",
"sha256:f4b0460a21f784abe17b496f66e74157a6c36116fa86da8bf6aa028b9e8ad5fe",
"sha256:f93d508ca64d924d478fb11e272e09524698f0c581d9032e68958cfbdd41faef"
],
"index": "pypi",
"version": "==2.7.5"
},
"python3-openid": { "python3-openid": {
"hashes": [ "hashes": [
"sha256:0086da6b6ef3161cfe50fb1ee5cceaf2cda1700019fda03c2c5c440ca6abe4fa", "sha256:0086da6b6ef3161cfe50fb1ee5cceaf2cda1700019fda03c2c5c440ca6abe4fa",
......
...@@ -82,8 +82,12 @@ SITE_ID = 1 ...@@ -82,8 +82,12 @@ SITE_ID = 1
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.postgresql',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 'NAME': os.environ['DB_NAME'],
'USER': os.environ['DB_USER'],
'PASSWORD': os.environ['DB_PASSWORD'],
'HOST': 'db',
'PORT': '5432',
} }
} }
......
...@@ -6,10 +6,10 @@ services: ...@@ -6,10 +6,10 @@ services:
db: db:
image: postgres:alpine image: postgres:alpine
environment: environment:
- POSTGRES_DB=vignette - POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=vignette - POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=changeme - POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=fr_FR.UTF-8 --lc-ctype=fr_FR.UTF-8 - POSTGRES_INITDB_ARGS=--encoding=UTF-8
volumes: volumes:
- db_data:/var/lib/postgresql/data - db_data:/var/lib/postgresql/data
restart: always restart: always
...@@ -28,6 +28,10 @@ services: ...@@ -28,6 +28,10 @@ services:
- SECRET_KEY=changemeinprod - SECRET_KEY=changemeinprod
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
- DEBUG=1 - DEBUG=1
# Pass needed configuration
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
volumes: volumes:
- ./backend:/usr/src/app - ./backend:/usr/src/app
ports: ports:
......
# This is a sample file to configure Docker
# It should be renammed as ".env" after changing the following parameters
DB_NAME=vignette
DB_USER=vignette
DB_PASSWORD=changeme
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment