Skip to content

Commit

Permalink
feat(orpd-1588):enable Redis, Celery workers, and adjust server setup…
Browse files Browse the repository at this point in the history
… (added security).

Uncommented and enabled Redis, Celery-worker, and Celery-beats in the Docker Compose configuration. Updated `.gitignore` to include specific certificate and database files. Modified `entry.sh` to refine HTTPS server startup messaging.
  • Loading branch information
hareshkainthdbt committed Jan 15, 2025
1 parent 928316e commit 6ba180e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 63 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,11 @@ webpack-stats.json
# Other
.DS_Store
/key.pem
!/-out

!/cert.crt

!/cert.key

!/cert.pem
!/db.sqlite3
118 changes: 59 additions & 59 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
volumes:
postgres_data:
driver: local
# redis_data:
# driver: local
redis_data:
driver: local

services:
db:
Expand Down Expand Up @@ -43,63 +43,63 @@ services:
networks:
- proxynet

# redis:
# image: redis
# # Expose port so we can query it for debugging
# ports:
# - "6379:6379"
#
# celery-worker:
# build:
# context: .
# cache_from:
# - fbr/application:latest
# image: fbr/application:latest
# command: celery --app fbr.celery_app worker --task-events --loglevel INFO
# entrypoint: ''
# volumes:
# - .:/app
# healthcheck:
# test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
# interval: 10s
# timeout: 5s
# retries: 2
# start_period: 5s
# depends_on:
# - redis
# - db
# environment:
# REDIS_ENDPOINT: redis://redis:6379
# DEBUG: true
# DJANGO_SETTINGS_MODULE: fbr.settings
# RDS_POSTGRES_CREDENTIALS: '{"password":"postgres","dbname":"fbr","engine":"postgres","port":5432,"dbInstanceIdentifier":"xxx","host":"db","username":"postgres"}'
# DATABASE_URL: postgres://postgres:[email protected]:5432/fbr # pragma: allowlist secret
#
# celery-beats:
# build:
# context: .
# cache_from:
# - fbr/application:latest
# image: fbr/application:latest
# command: celery --app fbr.celery_app beat --loglevel INFO
# entrypoint: ''
# volumes:
# - .:/app
# healthcheck:
# test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
# interval: 10s
# timeout: 5s
# retries: 2
# start_period: 5s
# depends_on:
# - redis
# - db
# environment:
# REDIS_ENDPOINT: redis://redis:6379
# DEBUG: true
# DJANGO_SETTINGS_MODULE: fbr.settings
# RDS_POSTGRES_CREDENTIALS: '{"password":"postgres","dbname":"fbr","engine":"postgres","port":5432,"dbInstanceIdentifier":"xxx","host":"db","username":"postgres"}'
# DATABASE_URL: postgres://postgres:[email protected]:5432/fbr # pragma: allowlist secret
redis:
image: redis
# Expose port so we can query it for debugging
ports:
- "6379:6379"

celery-worker:
build:
context: .
cache_from:
- fbr/application:latest
image: fbr/application:latest
command: celery --app fbr.celery_app worker --task-events --loglevel INFO
entrypoint: ''
volumes:
- .:/app
healthcheck:
test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
interval: 10s
timeout: 5s
retries: 2
start_period: 5s
depends_on:
- redis
- db
environment:
REDIS_ENDPOINT: redis://redis:6379
DEBUG: true
DJANGO_SETTINGS_MODULE: fbr.settings
RDS_POSTGRES_CREDENTIALS: '{"password":"postgres","dbname":"fbr","engine":"postgres","port":5432,"dbInstanceIdentifier":"xxx","host":"db","username":"postgres"}'
DATABASE_URL: postgres://postgres:[email protected]:5432/fbr # pragma: allowlist secret

celery-beats:
build:
context: .
cache_from:
- fbr/application:latest
image: fbr/application:latest
command: celery --app fbr.celery_app beat --loglevel INFO
entrypoint: ''
volumes:
- .:/app
healthcheck:
test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
interval: 10s
timeout: 5s
retries: 2
start_period: 5s
depends_on:
- redis
- db
environment:
REDIS_ENDPOINT: redis://redis:6379
DEBUG: true
DJANGO_SETTINGS_MODULE: fbr.settings
RDS_POSTGRES_CREDENTIALS: '{"password":"postgres","dbname":"fbr","engine":"postgres","port":5432,"dbInstanceIdentifier":"xxx","host":"db","username":"postgres"}'
DATABASE_URL: postgres://postgres:[email protected]:5432/fbr # pragma: allowlist secret

networks:
proxynet:
Expand Down
5 changes: 1 addition & 4 deletions entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,5 @@ else
fi

# Run Django server with SSL support
echo "Starting Django with HTTPS..."
echo "Starting server with HTTPS..."
exec python manage.py runserver_plus 0.0.0.0:8080 --cert-file "$CERT_FILE" --key-file "$KEY_FILE"

#echo "Starting server"
#python manage.py runserver 0.0.0.0:8080

0 comments on commit 6ba180e

Please sign in to comment.