Browse Source

updated docker-compose.yaml and requirements.in

included celery in docker-compose.yaml and updated requirements.in and
generated new requirements.txt
Ali 6 years ago
parent
commit
f82fb2be42
4 changed files with 34 additions and 0 deletions
  1. 1 0
      devproject/settings.py
  2. 25 0
      docker-compose.yaml
  3. 2 0
      requirements.in
  4. 6 0
      requirements.txt

+ 1 - 0
devproject/settings.py

@@ -169,6 +169,7 @@ INSTALLED_APPS = [
     "django.contrib.messages",
     "django.contrib.messages",
     "django.contrib.staticfiles",
     "django.contrib.staticfiles",
     # 3rd party apps used by Misago
     # 3rd party apps used by Misago
+    "celery"
     "debug_toolbar",
     "debug_toolbar",
     "mptt",
     "mptt",
     "rest_framework",
     "rest_framework",

+ 25 - 0
docker-compose.yaml

@@ -2,6 +2,31 @@
 # This is not for running your Misago site in docker
 # This is not for running your Misago site in docker
 version: "3.0"
 version: "3.0"
 services:
 services:
+  celery:
+    build: .
+    command: celery -A tasks worker --loglevel=info
+    environment:
+      # Postgres
+      - POSTGRES_USER=misago
+      - POSTGRES_PASSWORD=misago
+      - POSTGRES_DB=misago
+      - POSTGRES_HOST=postgres
+      - POSTGRES_TEST_DB=misago_test
+      # Superuser
+      - SUPERUSER_USERNAME=Admin
+      - SUPERUSER_EMAIL=admin@example.com
+      - SUPERUSER_PASSWORD=password
+    ports:
+      # Map port 8000 in the container to port 8000 on the host
+      # This way we can access the forum through http://localhost:8000
+      - "${MISAGO_DEVSERVER_PORT:-8000}:8000"
+    depends_on:
+      - postgres
+    tty: true
+    volumes:
+      # Map in the entire project into the container
+      # This makes sure files in the container updates on the fly as we were working locally
+      - .:/srv/misago:Z
   postgres:
   postgres:
     image: postgres:10
     image: postgres:10
     environment:
     environment:

+ 2 - 0
requirements.in

@@ -1,7 +1,9 @@
 beautifulsoup4<4.7
 beautifulsoup4<4.7
 bleach<2.2
 bleach<2.2
+celery
 django<2
 django<2
 djangorestframework<3.7
 djangorestframework<3.7
+django-celery
 django-debug-toolbar<1.9
 django-debug-toolbar<1.9
 django-htmlmin<0.11
 django-htmlmin<0.11
 django-mptt
 django-mptt

+ 6 - 0
requirements.txt

@@ -4,13 +4,18 @@
 #
 #
 #    pip-compile --output-file requirements.txt requirements.in
 #    pip-compile --output-file requirements.txt requirements.in
 #
 #
+amqp==1.4.9               # via kombu
+anyjson==0.3.3            # via kombu
 atomicwrites==1.2.1       # via pytest
 atomicwrites==1.2.1       # via pytest
 attrs==18.2.0             # via pytest
 attrs==18.2.0             # via pytest
 beautifulsoup4==4.6.3
 beautifulsoup4==4.6.3
+billiard==3.3.0.23        # via celery
 bleach==2.1.4
 bleach==2.1.4
+celery==3.1.26.post2
 certifi==2018.11.29       # via requests
 certifi==2018.11.29       # via requests
 chardet==3.0.4            # via requests
 chardet==3.0.4            # via requests
 defusedxml==0.5.0         # via python3-openid, social-auth-core
 defusedxml==0.5.0         # via python3-openid, social-auth-core
+django-celery==3.2.2
 django-debug-toolbar==1.8
 django-debug-toolbar==1.8
 django-htmlmin==0.10.0
 django-htmlmin==0.10.0
 django-js-asset==1.1.0    # via django-mptt
 django-js-asset==1.1.0    # via django-mptt
@@ -20,6 +25,7 @@ djangorestframework==3.6.4
 faker==0.8.18
 faker==0.8.18
 html5lib==0.999999999
 html5lib==0.999999999
 idna==2.8                 # via requests
 idna==2.8                 # via requests
+kombu==3.0.37             # via celery
 markdown==2.6.11
 markdown==2.6.11
 more-itertools==4.3.0     # via pytest
 more-itertools==4.3.0     # via pytest
 oauthlib==2.1.0           # via requests-oauthlib, social-auth-core
 oauthlib==2.1.0           # via requests-oauthlib, social-auth-core