Skip to content

Commit a2e4dba

Browse files
committed
revert: undo infra perf tweaks from d9109fd, keep reliability fixes
1 parent ad27f7f commit a2e4dba

3 files changed

Lines changed: 6 additions & 19 deletions

File tree

backend/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,9 @@ USER appuser
4141

4242
EXPOSE 8000
4343

44-
CMD ["sh", "-c", "python -m uvicorn main:app --host 0.0.0.0 --port 8000 --workers ${UVICORN_WORKERS:-1} --proxy-headers --forwarded-allow-ips '*'"]
44+
CMD ["python", "-m", "uvicorn", "main:app", \
45+
"--host", "0.0.0.0", \
46+
"--port", "8000", \
47+
"--workers", "4", \
48+
"--proxy-headers", \
49+
"--forwarded-allow-ips", "*"]

backend/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from fastapi import FastAPI
88
from fastapi.middleware.cors import CORSMiddleware
9-
from fastapi.middleware.gzip import GZipMiddleware
109

1110
from app.config import ALLOWED_ORIGINS, settings
1211
from app.database import close_db, init_db
@@ -54,9 +53,6 @@ async def lifespan(app: FastAPI):
5453
allow_headers=["*"],
5554
)
5655

57-
# Compress response bodies to reduce payload size over slow networks.
58-
app.add_middleware(GZipMiddleware, minimum_size=500)
59-
6056
# ── Routers ──────────────────────────────────────────────────────────────────
6157
app.include_router(exam_router)
6258

backend/nginx.conf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,6 @@ server {
2626
listen 443 ssl;
2727
server_name api.halicexamgenius.app;
2828

29-
# ── Compression ─────────────────────────────────────────────────────
30-
gzip on;
31-
gzip_vary on;
32-
gzip_proxied any;
33-
gzip_comp_level 5;
34-
gzip_min_length 512;
35-
gzip_types
36-
application/json
37-
text/plain
38-
text/css
39-
application/javascript
40-
text/xml
41-
application/xml;
42-
4329
# ── SSL certificates (managed by Certbot on the host) ────────────────
4430
ssl_certificate /etc/letsencrypt/live/api.halicexamgenius.app/fullchain.pem;
4531
ssl_certificate_key /etc/letsencrypt/live/api.halicexamgenius.app/privkey.pem;

0 commit comments

Comments
 (0)