Skip to content

Commit

Permalink
add backend healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
d2avids committed Nov 15, 2024
1 parent c32a81a commit fedbfa3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ RUN pip install -r requirements.txt --no-cache-dir

COPY . .

CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:8080 --workers ${GUNICORN_WORKERS} --threads 2 --timeout ${GUNICORN_TIMEOUT} backend.wsgi"]
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:8080 --workers ${GUNICORN_WORKERS} --threads 3 --timeout ${GUNICORN_TIMEOUT} --max-requests ${GUNICORN_MAX_REQUESTS} --max-requests-jitter ${GUNICORN_MAX_REQUESTS_JITTER} backend.wsgi"]
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ services:
networks:
- internal
environment:
- GUNICORN_WORKERS=3
- GUNICORN_WORKERS=2
- GUNICORN_TIMEOUT=60
- GUNICORN_MAX_REQUESTS=1000
- GUNICORN_MAX_REQUESTS_JITTER=100
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/api/v1/news || exit 1" ]
interval: 15s
timeout: 7s
retries: 3
frontend:
image: teamcode01/lesya_and_moa_frontend:latest
restart: always
Expand Down
8 changes: 4 additions & 4 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
listen 80;
server_tokens off;
client_max_body_size 20M;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
send_timeout 600s;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
send_timeout 60s;

location / {
root /usr/src/app/src/app/dist;
Expand Down

0 comments on commit fedbfa3

Please sign in to comment.