Skip to content

Commit

Permalink
cleanup and fix docker local builds (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak authored Feb 20, 2024
1 parent fba55aa commit f8bb89c
Show file tree
Hide file tree
Showing 6 changed files with 467 additions and 425 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ factory-boy = "==3.3.0"
django-debug-toolbar = "==4.2.0"
django-extensions = "==3.2.3"
psycopg = {extras = ["binary"], version = "==3.1.17"}
watchdog = "==4.0.0"

[requires]
python_version = "3.11"
860 changes: 456 additions & 404 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion compose/local/django/celery/beat/start
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ set -o nounset


rm -f './celerybeat.pid'
celery -A core.celery_app beat -l INFO
watchmedo \
auto-restart --directory=./ --pattern=*.py --recursive -- \
celery --workdir="/app" -A core.celery_app beat --loglevel=INFO
4 changes: 3 additions & 1 deletion compose/local/django/celery/worker/start
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ set -o errexit
set -o nounset


watchgod celery.__main__.main --args -A core.celery_app worker -l INFO
watchmedo \
auto-restart --directory=./ --pattern=*.py --recursive -- \
celery --workdir="/app" -A core.celery_app worker --loglevel=INFO
17 changes: 2 additions & 15 deletions docker-compose.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ services:
build:
context: .
dockerfile: ./compose/local/django/Dockerfile
image: django
container_name: ayushma_local_django
image: ayushma_local
depends_on:
- postgres
- redis
Expand All @@ -27,8 +26,7 @@ services:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: postgres
container_name: ayushma_local_postgres
image: ayushma_postgres
volumes:
- ayushma_local_postgres_data:/var/lib/postgresql/data:Z
- ayushma_local_postgres_data_backups:/backups:z
Expand All @@ -37,24 +35,13 @@ services:

redis:
image: redis:6
container_name: ayushma_local_redis

celeryworker:
<<: *django
image: ayushma_local_celeryworker
container_name: ayushma_local_celeryworker
depends_on:
- redis
- postgres
ports: []
command: /start-celeryworker

celerybeat:
<<: *django
image: ayushma_local_celerybeat
container_name: ayushma_local_celerybeat
depends_on:
- redis
- postgres
ports: []
command: /start-celerybeat
6 changes: 2 additions & 4 deletions docker-compose.production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: ayushma_production_django
image: ayushma_production
depends_on:
- postgres
- redis
Expand All @@ -24,7 +24,7 @@ services:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: ayushma_production_postgres
image: ayushma_postgres
volumes:
- production_postgres_data:/var/lib/postgresql/data:Z
- production_postgres_data_backups:/backups:z
Expand All @@ -36,12 +36,10 @@ services:

celeryworker:
<<: *django
image: ayushma_production_celeryworker
ports: []
command: /start-celeryworker

celerybeat:
<<: *django
image: ayushma_production_celerybeat
ports: []
command: /start-celerybeat

0 comments on commit f8bb89c

Please sign in to comment.