Skip to content

Commit a9411a3

Browse files
committed
Update dockerfile
1 parent b93b1e1 commit a9411a3

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ RUN rm -rf ./assets
1616

1717
EXPOSE 8000
1818

19-
CMD ["gunicorn" , "-b", "0.0.0.0:8000", "app.wsgi"]
19+
VOLUME /app/storage
20+
21+
HEALTHCHECK --interval=5s --timeout=2s --retries=5 --start-period=2s \
22+
CMD python manage.py health check
23+
24+
CMD ["gunicorn" , "-b", "0.0.0.0:8000", "app.wsgi"]

docker-compose.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services:
3737

3838
# Web UI Service
3939
web:
40-
image: "clivern_silverback:1.0.0"
40+
image: "clivern/silverback:latest"
4141
build: .
4242
command: 'gunicorn --bind 0.0.0.0:8000 app.wsgi'
4343
volumes:
@@ -53,9 +53,9 @@ services:
5353
timeout: 1s
5454
retries: 5
5555

56-
# Worker Service
56+
# Worker1 Service
5757
worker1:
58-
image: "clivern_silverback:1.0.0"
58+
image: "clivern/silverback:latest"
5959
build: .
6060
command: 'celery -A app worker --loglevel=info -n worker1'
6161
volumes:
@@ -66,7 +66,25 @@ services:
6666
- rabbitmq
6767
restart: always
6868
healthcheck:
69-
test: 'python3 manage.py health check'
69+
test: 'python manage.py health check'
70+
interval: 3s
71+
timeout: 1s
72+
retries: 5
73+
74+
# Worker2 Service
75+
worker2:
76+
image: "clivern/silverback:latest"
77+
build: .
78+
command: 'celery -A app worker --loglevel=info -n worker2'
79+
volumes:
80+
- '.:/app'
81+
depends_on:
82+
- db
83+
- redis
84+
- rabbitmq
85+
restart: always
86+
healthcheck:
87+
test: 'python manage.py health check'
7088
interval: 3s
7189
timeout: 1s
7290
retries: 5

0 commit comments

Comments
 (0)