diff --git a/.env.sample b/.env.sample new file mode 100644 index 00000000..1dac9169 --- /dev/null +++ b/.env.sample @@ -0,0 +1,15 @@ +# CELERY +# ----------------------------------------------------------------------------- +# CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ + +# DJANGO +# ----------------------------------------------------------------------------- +DJANGO_PORT=58000 +DJANGO_HOST=127.0.0.1 + +# RABBITMQ +# ----------------------------------------------------------------------------- +# RABBITMQ_HOST= +# RABBITMQ_PASSWORD= +RABBITMQ_PORT=5672 +# RABBITMQ_USER= diff --git a/.gitignore b/.gitignore index d6be2b0a..b9774de3 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ coverage.xml .eggs/ .python-version venv +.env diff --git a/docker-compose.yml b/docker-compose.yml index bab3f4e1..ee48dd27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,9 +19,9 @@ services: context: . dockerfile: docker/django/Dockerfile ports: - - "127.0.0.1:58000:8000" + - "${DJANGO_HOST:-127.0.0.1}:${DJANGO_PORT:-58000}:8000" entrypoint: ["/app/docker/django/entrypoint.sh"] - command: ["python3", "manage.py", "runserver", "0.0.0.0:8000"] + command: ["python3", "manage.py", "runserver", "0.0.0.0:${DJANGO_PORT:-8000}"] tty: true volumes: - './django_celery_beat/:/app/django_celery_beat/' @@ -36,7 +36,7 @@ services: dockerfile: docker/celery-beat/Dockerfile entrypoint: ["/app/docker/celery-beat/entrypoint.sh"] environment: - CELERY_BROKER_URL: 'amqp://guest:guest@rabbit:5672' + CELERY_BROKER_URL: 'amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@${RABBITMQ_HOST:-rabbit}:${RABBITMQ_PORT:-5672}' command: ["python3", '-m', "celery", "-A", "mysite", "beat", "-l", "info", "--scheduler", "django_celery_beat.schedulers:DatabaseScheduler"] tty: true volumes: @@ -45,7 +45,7 @@ services: rabbit: image: rabbitmq ports: - - "5672:5672" + - "${RABBITMQ_PORT:-5672}:5672" postgres: image: postgres environment: diff --git a/issue_template.md b/issue_template.md index 56f4a83a..94ae3cd0 100644 --- a/issue_template.md +++ b/issue_template.md @@ -1,6 +1,6 @@ ### Summary: -Include a *brief* descrioption of the problem here, and fill out the version info below. +Include a *brief* description of the problem here, and fill out the version info below. * Celery Version: * Celery-Beat Version: