Skip to content

Instantly share code, notes, and snippets.

@hakjoon
Forked from jsheedy/Dockerfile
Created October 4, 2023 15:03
Show Gist options
  • Select an option

  • Save hakjoon/ff63edee902c706bd90a72521e6fd360 to your computer and use it in GitHub Desktop.

Select an option

Save hakjoon/ff63edee902c706bd90a72521e6fd360 to your computer and use it in GitHub Desktop.

Revisions

  1. @jsheedy jsheedy created this gist Jul 2, 2018.
    22 changes: 22 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    FROM python:3.6

    RUN mkdir /app
    ADD requirements.txt /app/
    WORKDIR /app/
    RUN pip install -r requirements.txt

    CMD [ \
    "watchmedo", \
    "auto-restart", \
    "--directory", "./my_project", \
    "--patterns", "*.py", \
    "--recursive", \
    "--", \
    "celery", \
    "worker", \
    "-A", "my_project.celery", \
    "--concurrency", "1", \
    "--pool", "solo", \
    "--events", \
    "-l", "INFO" \
    ]
    21 changes: 21 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    version: "3"

    services:

    redis:
    image: redis:alpine
    expose:
    - "6379"
    container_name: redis

    celery-worker:
    build:
    dockerfile: ./docker/celery-worker/Dockerfile
    context: .
    environment:
    - PWD
    volumes:
    - ${PWD}:/app
    container_name: celery-worker
    depends_on:
    - redis