Skip to content

Commit fcf29c7

Browse files
Merge pull request #970 from basedosdados/feat/prepare-for-chatbot-service
feat: prepare for chatbot service
2 parents d787a85 + 8e907fc commit fcf29c7

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎.env.example‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# =============================================================================
44

55
# Django
6+
DJANGO_JWT_ALGORITHM=HS256
67
DJANGO_SECRET_KEY=dev-secret-key-change-in-production
78
DJANGO_SETTINGS_MODULE=backend.settings.local
89

‎backend/settings/base.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
}
8383

8484
SIMPLE_JWT = {
85+
"ALGORITHM": getenv("DJANGO_JWT_ALGORITHM"),
8586
"ACCESS_TOKEN_LIFETIME": timedelta(hours=1),
8687
"REFRESH_TOKEN_LIFETIME": timedelta(days=7),
8788
"USER_AUTHENTICATION_RULE": "backend.apps.chatbot.authentication.authentication_rule",
@@ -196,6 +197,7 @@
196197
# GraphQL JWT configurations
197198
GRAPHQL_JWT = {
198199
"JWT_AUTH_HEADER_PREFIX": "Bearer",
200+
"JWT_ALGORITHM": getenv("DJANGO_JWT_ALGORITHM"),
199201
"JWT_VERIFY_EXPIRATION": True,
200202
"JWT_EXPIRATION_DELTA": timedelta(days=7),
201203
"JWT_REFRESH_EXPIRATION_DELTA": timedelta(days=14),

‎compose.yaml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ services:
1313
memlock:
1414
soft: -1
1515
hard: -1
16-
volumes: [esdata:/usr/share/elasticsearch/data]
1716
ports: [9200:9200, 9300:9300]
17+
volumes: [esdata:/usr/share/elasticsearch/data]
1818
healthcheck:
1919
test: [CMD-SHELL, curl -s http://localhost:9200 >/dev/null || exit 1]
2020
interval: 1m
@@ -37,6 +37,7 @@ services:
3737
env_file: [.env]
3838
ports: [5432:5432]
3939
volumes: [pgdata:/var/lib/postgresql/data]
40+
networks: [default, db_network]
4041
healthcheck:
4142
test: [CMD, pg_isready, -U, postgres]
4243
interval: 1m
@@ -59,10 +60,11 @@ services:
5960
memory: 4G
6061
env_file: [.env]
6162
command: [poetry, run, /app/start-server-dev.sh]
62-
volumes: [.:/app, $HOME/.basedosdados/credentials:/app/credentials:ro]
6363
ports:
6464
- 8080:80 # API port
6565
- 5678:5678 # Debug port
66+
volumes: [.:/app, $HOME/.basedosdados/credentials:/app/credentials:ro]
67+
networks: [default, db_network]
6668
depends_on:
6769
index:
6870
condition: service_healthy
@@ -80,3 +82,7 @@ services:
8082
volumes:
8183
esdata:
8284
pgdata:
85+
# External network used for database access by other services (e.g., chatbot API)
86+
networks:
87+
db_network:
88+
name: db_network

0 commit comments

Comments
 (0)