Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# =============================================================================

# Django
DJANGO_JWT_ALGORITHM=HS256
DJANGO_SECRET_KEY=dev-secret-key-change-in-production
DJANGO_SETTINGS_MODULE=backend.settings.local

Expand Down
2 changes: 2 additions & 0 deletions backend/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
}

SIMPLE_JWT = {
"ALGORITHM": getenv("DJANGO_JWT_ALGORITHM"),
"ACCESS_TOKEN_LIFETIME": timedelta(hours=1),
"REFRESH_TOKEN_LIFETIME": timedelta(days=7),
"USER_AUTHENTICATION_RULE": "backend.apps.chatbot.authentication.authentication_rule",
Expand Down Expand Up @@ -195,6 +196,7 @@
# GraphQL JWT configurations
GRAPHQL_JWT = {
"JWT_AUTH_HEADER_PREFIX": "Bearer",
"JWT_ALGORITHM": getenv("DJANGO_JWT_ALGORITHM"),
"JWT_VERIFY_EXPIRATION": True,
"JWT_EXPIRATION_DELTA": timedelta(days=7),
"JWT_REFRESH_EXPIRATION_DELTA": timedelta(days=14),
Expand Down
10 changes: 8 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ services:
memlock:
soft: -1
hard: -1
volumes: [esdata:/usr/share/elasticsearch/data]
ports: [9200:9200, 9300:9300]
volumes: [esdata:/usr/share/elasticsearch/data]
healthcheck:
test: [CMD-SHELL, curl -s http://localhost:9200 >/dev/null || exit 1]
interval: 1m
Expand All @@ -37,6 +37,7 @@ services:
env_file: [.env]
ports: [5432:5432]
volumes: [pgdata:/var/lib/postgresql/data]
networks: [default, db_network]
healthcheck:
test: [CMD, pg_isready, -U, postgres]
interval: 1m
Expand All @@ -59,10 +60,11 @@ services:
memory: 4G
env_file: [.env]
command: [poetry, run, /app/start-server-dev.sh]
volumes: [.:/app, $HOME/.basedosdados/credentials:/app/credentials:ro]
ports:
- 8080:80 # API port
- 5678:5678 # Debug port
volumes: [.:/app, $HOME/.basedosdados/credentials:/app/credentials:ro]
networks: [default, db_network]
depends_on:
index:
condition: service_healthy
Expand All @@ -80,3 +82,7 @@ services:
volumes:
esdata:
pgdata:
# External network used for database access by other services (e.g., chatbot API)
networks:
db_network:
name: db_network
Loading