diff --git a/artel/artel/settings/base.py b/artel/artel/settings/base.py index fad24bd..9c9c27d 100644 --- a/artel/artel/settings/base.py +++ b/artel/artel/settings/base.py @@ -93,7 +93,7 @@ import dj_database_url as db_url DATABASES = { "default": db_url.parse( - "postgres://comfy:password@db/comfy_shop" + os.environ.get("DATABASE_URL") ) } diff --git a/artel/artel/settings/production.py b/artel/artel/settings/production.py index 9ca4ed7..baf81e4 100644 --- a/artel/artel/settings/production.py +++ b/artel/artel/settings/production.py @@ -2,7 +2,10 @@ from .base import * DEBUG = False -try: - from .local import * -except ImportError: - pass +SECRET_KEY = os.environ.get("SECRET_KEY") +ALLOWED_HOSTS = [ + "91.195.93.3", + "localhost", + "0.0.0.0", + "127.0.0.1" +] diff --git a/artel/docker-compose-prod.yml b/artel/docker-compose-prod.yml index 70646be..c4838c2 100644 --- a/artel/docker-compose-prod.yml +++ b/artel/docker-compose-prod.yml @@ -8,13 +8,22 @@ services: - "8000:8000" volumes: - ./:/app + environment: + - SECRET_KEY + - DATABASE_URL + - DJANGO_SETTINGS_MODULE + env_file: + - .env + db: image: postgres restart: always environment: - POSTGRES_ROOT_PASSWORD: password - POSTGRES_USER: comfy - POSTGRES_PASSWORD: password - POSTGRES_DB: comfy_shop + - POSTGRES_ROOT_PASSWORD + - POSTGRES_USER + - POSTGRES_PASSWORD + - POSTGRES_DB volumes: - ../postgres/:/var/lib/postgresql + env_file: + - .env \ No newline at end of file diff --git a/artel/docker-compose.yml b/artel/docker-compose.yml index 94c441f..7c7d896 100644 --- a/artel/docker-compose.yml +++ b/artel/docker-compose.yml @@ -8,13 +8,20 @@ services: - "8000:8000" volumes: - ./:/app + environment: + - SECRET_KEY + - DATABASE_URL + env_file: + - .env db: image: postgres restart: always environment: - POSTGRES_ROOT_PASSWORD: password - POSTGRES_USER: comfy - POSTGRES_PASSWORD: password - POSTGRES_DB: comfy_shop + - POSTGRES_ROOT_PASSWORD + - POSTGRES_USER + - POSTGRES_PASSWORD + - POSTGRES_DB volumes: - ../postgres/:/var/lib/postgresql + env_file: + - .env