Added celery to docker compose stack
This commit is contained in:
parent
0a1ca260d6
commit
4d6c86b355
2 changed files with 35 additions and 1 deletions
19
compose/dev/celery/Dockerfile
Normal file
19
compose/dev/celery/Dockerfile
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
FROM python:3.12-bookworm
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
build-essential \
|
||||
libpq-dev \
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV VIRTUAL_ENV=/venv \
|
||||
PATH=/venv/bin:$PATH
|
||||
|
||||
RUN python -m venv /venv
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements/django.txt .
|
||||
RUN pip install --no-cache-dir --requirement django.txt
|
||||
|
||||
CMD ["celery", "-A", "config", "worker", "-l", "info"]
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
services:
|
||||
fyp-django:
|
||||
fyp-django-dev:
|
||||
container_name: fyp-django-dev
|
||||
build:
|
||||
context: ../../
|
||||
|
|
@ -66,6 +66,21 @@ services:
|
|||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
fyp-celery-dev:
|
||||
container_name: fyp-celery-dev
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: compose/dev/celery/Dockerfile
|
||||
env_file:
|
||||
- ../../.env
|
||||
volumes:
|
||||
- ../../:/app
|
||||
depends_on:
|
||||
fyp-redis-dev:
|
||||
condition: service_healthy
|
||||
fyp-postgres-dev:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
fyp_postgres_data:
|
||||
|
|
|
|||
Loading…
Reference in a new issue