Commit 47e38116 by Chif Gergő

Update celery, create celery worker in prod deployment

parent a2c20e44
...@@ -10,13 +10,12 @@ COPY Pipfile* .env ./ ...@@ -10,13 +10,12 @@ COPY Pipfile* .env ./
# This env variable needed to pipenv find .env file # This env variable needed to pipenv find .env file
ENV PIPENV_DOTENV_LOCATION=/usr/cloud/portal/.env ENV PIPENV_DOTENV_LOCATION=/usr/cloud/portal/.env
# Install dependencies # Install dependencies
RUN pipenv install -d RUN pipenv install
# Copy sources # Copy sources
COPY ./recircle ./recircle COPY ./recircle ./recircle
# Set working dir where the manage.py found # Set working dir where the manage.py found
WORKDIR /usr/cloud/portal/recircle WORKDIR /usr/cloud/portal/recircle
# Migrate and start server # Migrate and start server
CMD pipenv run python manage.py migrate \ CMD pipenv run python manage.py migrate \
&& pipenv run python manage.py runserver 0.0.0.0:8000 \ && pipenv run python manage.py runserver 0.0.0.0:8000
&& pipenv run celery -A recircle worker -B
...@@ -97,18 +97,18 @@ ...@@ -97,18 +97,18 @@
"redis" "redis"
], ],
"hashes": [ "hashes": [
"sha256:9ae2e73b93cc7d6b48b56aaf49a68c91752d0ffd7dfdcc47f842ca79a6f13eae", "sha256:c3f4173f83ceb5a5c986c5fdaefb9456de3b0729a72a5776e46bd405fda7b647",
"sha256:c2037b6a8463da43b19969a0fc13f9023ceca6352b4dd51be01c66fbbb13647e" "sha256:d1762d6065522879f341c3d67c2b9fe4615eb79756d59acb1434601d4aca474b"
], ],
"index": "pypi", "index": "pypi",
"version": "==4.4.4" "version": "==4.4.5"
}, },
"certifi": { "certifi": {
"hashes": [ "hashes": [
"sha256:1d987a998c75633c40847cc966fcf5904906c920a7f17ef374f5aa4282abd304", "sha256:5ad7e9a056d25ffa5082862e36f119f7f7cec6457fa07ee2f8c339814b80c9b1",
"sha256:51fcb31174be6e6664c5f69e3e1691a2d72a1a12e90f872cbdb1567eb47b6519" "sha256:9cd41137dc19af6a5e03b630eefe7d1f458d964d406342dd3edf625839b944cc"
], ],
"version": "==2020.4.5.1" "version": "==2020.4.5.2"
}, },
"cffi": { "cffi": {
"hashes": [ "hashes": [
...@@ -246,11 +246,11 @@ ...@@ -246,11 +246,11 @@
}, },
"django-guardian": { "django-guardian": {
"hashes": [ "hashes": [
"sha256:8cacf49ebcc1e545f0a8997971eec0fe109f5ed31fc2a569a7bf5615453696e2", "sha256:0e70706c6cda88ddaf8849bddb525b8df49de05ba0798d4b3506049f0d95cbc8",
"sha256:ac81e88372fdf1795d84ba065550e739b42e9c6d07cdf201cf5bbf9efa7f396c" "sha256:ed2de26e4defb800919c5749fb1bbe370d72829fbd72895b6cf4f7f1a7607e1b"
], ],
"index": "pypi", "index": "pypi",
"version": "==2.2.0" "version": "==2.3.0"
}, },
"django-templated-mail": { "django-templated-mail": {
"hashes": [ "hashes": [
...@@ -289,6 +289,13 @@ ...@@ -289,6 +289,13 @@
], ],
"version": "==0.9.2" "version": "==0.9.2"
}, },
"future": {
"hashes": [
"sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"
],
"markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"version": "==0.18.2"
},
"gunicorn": { "gunicorn": {
"hashes": [ "hashes": [
"sha256:1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626", "sha256:1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626",
...@@ -359,11 +366,11 @@ ...@@ -359,11 +366,11 @@
}, },
"importlib-metadata": { "importlib-metadata": {
"hashes": [ "hashes": [
"sha256:2a688cbaa90e0cc587f1df48bdc97a6eadccdcd9c35fb3f976a09e3b5016d90f", "sha256:0505dd08068cfec00f53a74a0ad927676d7757da81b7436a6eefe4c7cf75c545",
"sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e" "sha256:15ec6c0fd909e893e3a08b3a7c76ecb149122fb14b7efe1199ddd4c7c57ea958"
], ],
"markers": "python_version < '3.8'", "markers": "python_version < '3.8'",
"version": "==1.6.0" "version": "==1.6.1"
}, },
"incremental": { "incremental": {
"hashes": [ "hashes": [
...@@ -894,10 +901,10 @@ ...@@ -894,10 +901,10 @@
"develop": { "develop": {
"certifi": { "certifi": {
"hashes": [ "hashes": [
"sha256:1d987a998c75633c40847cc966fcf5904906c920a7f17ef374f5aa4282abd304", "sha256:5ad7e9a056d25ffa5082862e36f119f7f7cec6457fa07ee2f8c339814b80c9b1",
"sha256:51fcb31174be6e6664c5f69e3e1691a2d72a1a12e90f872cbdb1567eb47b6519" "sha256:9cd41137dc19af6a5e03b630eefe7d1f458d964d406342dd3edf625839b944cc"
], ],
"version": "==2020.4.5.1" "version": "==2020.4.5.2"
}, },
"chardet": { "chardet": {
"hashes": [ "hashes": [
...@@ -976,11 +983,11 @@ ...@@ -976,11 +983,11 @@
}, },
"importlib-metadata": { "importlib-metadata": {
"hashes": [ "hashes": [
"sha256:2a688cbaa90e0cc587f1df48bdc97a6eadccdcd9c35fb3f976a09e3b5016d90f", "sha256:0505dd08068cfec00f53a74a0ad927676d7757da81b7436a6eefe4c7cf75c545",
"sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e" "sha256:15ec6c0fd909e893e3a08b3a7c76ecb149122fb14b7efe1199ddd4c7c57ea958"
], ],
"markers": "python_version < '3.8'", "markers": "python_version < '3.8'",
"version": "==1.6.0" "version": "==1.6.1"
}, },
"mccabe": { "mccabe": {
"hashes": [ "hashes": [
......
...@@ -13,36 +13,46 @@ services: ...@@ -13,36 +13,46 @@ services:
depends_on: depends_on:
- backend - backend
db:
image: postgres:13-alpine
environment:
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_DB: ${DATABASE_NAME}
networks:
- backend
redis:
image: redis:alpine
networks:
- backend
backend: backend:
build: build:
context: . context: .
dockerfile: ./Dockerfile.prod dockerfile: ./Dockerfile.prod
image: portal:compose
networks: networks:
- backend - backend
expose: expose:
- "8000" - "8000"
volumes: volumes:
- "/static:/static" - "/static:/static"
depends_on: depends_on:
- db - db
- redis - redis
db: celery:
image: postgres:13-alpine build:
environment: context: .
POSTGRES_PASSWORD: ${DATABASE_PASSWORD} dockerfile: ./Dockerfile.prod
POSTGRES_USER: ${DATABASE_USER} command: pipenv run celery -A recircle worker -B -l INFO
POSTGRES_DB: ${DATABASE_NAME}
networks: networks:
- backend - backend
depends_on:
redis:
image: redis:alpine
ports:
- "6379"
networks:
- backend - backend
- db
- redis
networks: networks:
backend: backend:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment