Skip to content

Commit

Permalink
Fixes setting env files
Browse files Browse the repository at this point in the history
  • Loading branch information
sudan45 committed Aug 30, 2024
1 parent b598028 commit a407540
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ services:
- redis-data:/data

qdrant:
image: qdrant/qdrant:latest
image: qdrant/qdrant:v1.11.3
ports:
- "6333:6333"
- 127.0.0.1:6333:6333
volumes:
- qdrant_data:/qdrant/storage
restart: always
environment:
- QDRANT_HOST=0.0.0.0

web:
build: .
env_file:
Expand All @@ -39,7 +40,8 @@ services:
volumes:
- .:/code
ports:
- "8100:8100"
- 127.0.0.1:8001:8001

depends_on:
- db
- redis
Expand Down
8 changes: 4 additions & 4 deletions gh-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
services:
db:
image: postgres:15-alpine
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- postgres-data13:/var/lib/postgresql/data
- postgres-data16:/var/lib/postgresql/data

redis:
image: redis:6-alpine
volumes:
- redis-data:/data

qdrant:
image: qdrant/qdrant:latest
image: qdrant/qdrant:v1.11.3
ports:
- "6333:6333"
volumes:
Expand Down Expand Up @@ -61,6 +61,6 @@ services:
- redis

volumes:
postgres-data13:
postgres-data16:
redis-data:
qdrant_data:
13 changes: 10 additions & 3 deletions main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
https://docs.djangoproject.com/en/5.1/ref/settings/
"""

import os
from pathlib import Path

import environ
Expand All @@ -21,6 +22,10 @@
DJANGO_DEBUG=(bool, False),
DJANGO_SECRET_KEY=str,
DJANGO_CORS_ORIGIN_REGEX_WHITELIST=(list, []),
DJANGO_ALLOWED_HOST=(list, ["*"]),
DJANGO_STATIC_ROOT=(str, os.path.join(BASE_DIR, "assets/static")), # Where to store
DJANGO_MEDIA_ROOT=(str, os.path.join(BASE_DIR, "assets/media")), # Where to store
DJANGO_TIME_ZONE=(str, "UTC"),
# Database
DATABASE_NAME=str,
DATABASE_USER=str,
Expand All @@ -43,9 +48,9 @@
SECRET_KEY = env("DJANGO_SECRET_KEY")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = env("DJANGO_DEBUG")

ALLOWED_HOSTS = []
ALLOWED_HOSTS = env("DJANGO_ALLOWED_HOST")


# Application definition
Expand Down Expand Up @@ -130,7 +135,7 @@

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"
TIME_ZONE = env("DJANGO_TIME_ZONE")

USE_I18N = True

Expand All @@ -141,6 +146,8 @@
# https://docs.djangoproject.com/en/5.1/howto/static-files/

STATIC_URL = "static/"
STATIC_ROOT = env("DJANGO_STATIC_ROOT")
MEDIA_ROOT = env("DJANGO_MEDIA_ROOT")

# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
Expand Down

0 comments on commit a407540

Please sign in to comment.