Skip to content

Commit

Permalink
build: remove ratelimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Jun 18, 2024
1 parent 380abf9 commit 0b2add7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
12 changes: 0 additions & 12 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
{
order rate_limit before basicauth
}

:{$APP_PORT} {
rate_limit {
zone dynamic_example {
key {remote_host}
events {$EVENTS_PER_WINDOW}
window 60s
}
}

handle_path /api/* {
reverse_proxy http://localhost:{$SERVER_PORT}
}
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ ENV APP_PORT 7860
ENV OMP_NUM_THREADS 2
ENV CT2_USE_EXPERIMENTAL_PACKED_GEMM 1
ENV CT2_FORCE_CPU_ISA AVX512
ENV EVENTS_PER_WINDOW 5

EXPOSE $APP_PORT
5 changes: 2 additions & 3 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN poetry install --without dev

FROM caddy:builder-alpine as caddy-builder

RUN xcaddy build --with github.com/mholt/caddy-ratelimit
RUN xcaddy build


FROM python:slim
Expand All @@ -25,7 +25,6 @@ ENV HOME /home/user
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV SERVER_PORT 5000
ENV EVENTS_PER_WINDOW 100000

RUN useradd -m -u 1000 user

Expand All @@ -34,7 +33,7 @@ USER user
WORKDIR $HOME/app

COPY --chown=user --from=caddy-builder /usr/bin/caddy /usr/bin/caddy
COPY --chown=user --from=python-builder /usr/local/bin /usr/local/bin
COPY --chown=user --from=python-builder /usr/local/bin/gunicorn /usr/local/bin/supervisord /usr/local/bin/
COPY --chown=user --from=python-builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --chown=user . $HOME/app

Expand Down

0 comments on commit 0b2add7

Please sign in to comment.