Skip to content

Commit

Permalink
feat(nginx): base docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Nov 26, 2023
1 parent 003b756 commit 337b88d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/nginx/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!etc/nginx/
!data/
37 changes: 37 additions & 0 deletions packages/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ghcr.io/alwatr/nginx-json:2.0.0

COPY etc/nginx/ /etc/nginx/
COPY data/ .
RUN ls -RlahF /etc/nginx /data

# ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \
# NGINX_SENDFILE=on \
# NGINX_SENDFILE_MAX_CHUNK=2m \
# NGINX_TCP_NOPUSH=on \
# NGINX_TCP_NODELAY=on \
# NGINX_OPEN_FILE_CACHE="max=5000 inactive=1h" \
# NGINX_OPEN_FILE_CACHE_VALID=1s \
# NGINX_OPEN_FILE_CACHE_MIN_USES=2 \
# NGINX_OUTPUT_BUFFERS="8 8k" \
# NGINX_EXPIRES_DYNAMIC=epoch \
# NGINX_EXPIRES_STATIC=max \
# NGINX_EXPIRES_DEFAULT=epoch \
# NGINX_LIMIT_REQ_RATE=400 \
# NGINX_LIMIT_REQ_BURST=1000 \
# NGINX_DISABLE_SYMLINKS=if_not_owner

ARG BUILD_REV
ARG BUILD_DATE
LABEL org.opencontainers.image.title="alwatr/storage-server" \
org.opencontainers.image.description="This is a high-performance version of NGINX, which has been enhanced by Alwatr for the purpose of serving JSON content efficiently." \
org.opencontainers.image.base.name="ghcr.io/alwatr/nginx-json:2.0.0" \
org.opencontainers.image.version="2.0.0" \
org.opencontainers.image.ref.name="2.0.0-nginx1.25.3-alpine3.18-slim" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REV} \
org.opencontainers.image.vendor="Alwatr" \
org.opencontainers.image.source="https://github.com/Alwatr/storage" \
org.opencontainers.image.url="https://github.com/Alwatr/storage" \
org.opencontainers.image.documentation="https://github.com/Alwatr/storage" \
org.opencontainers.image.authors="S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com), S. Amir Mohammad Najafi <njfamirm@gmail.com> (https://njfamirm.ir/)"
9 changes: 9 additions & 0 deletions packages/nginx/data/error.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ok": false,
"statusCode": <!--# echo var="status" default="500" -->,
"errorCode": "serve_storage_error",
"meta": {
"server": "alwatr/storage",
"status": "<!--# echo var="status_text" default="Something goes wrong." -->"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511 /_error.json;

location = /_error.json {
internal;
ssi on;
ssi_types *;
auth_basic off;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
location = / {
# return static json for home page
default_type application/json;
return 200 '{"ok": true, "data": "..:: Alwatr Accelerated Storage Server ::.."}';
}

0 comments on commit 337b88d

Please sign in to comment.