{"id":18624909,"url":"https://github.com/rhzs/nginx-static","last_synced_at":"2026-04-27T16:31:17.422Z","repository":{"id":91124666,"uuid":"248451755","full_name":"rhzs/nginx-static","owner":"rhzs","description":"Lightweight Nginx Static suitable for ReactJS, VueJS, Svelte, Other SPAs","archived":false,"fork":false,"pushed_at":"2020-03-19T08:42:49.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-17T07:08:07.220Z","etag":null,"topics":["docker","http-server","lightweight","nginx","serves","static-site","traefik"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhzs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-19T08:42:16.000Z","updated_at":"2021-05-04T16:28:16.000Z","dependencies_parsed_at":"2023-03-15T14:30:16.040Z","dependency_job_id":null,"html_url":"https://github.com/rhzs/nginx-static","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhzs/nginx-static","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhzs%2Fnginx-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhzs%2Fnginx-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhzs%2Fnginx-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhzs%2Fnginx-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhzs","download_url":"https://codeload.github.com/rhzs/nginx-static/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhzs%2Fnginx-static/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32345802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","http-server","lightweight","nginx","serves","static-site","traefik"],"created_at":"2024-11-07T04:31:52.631Z","updated_at":"2026-04-27T16:31:17.403Z","avatar_url":"https://github.com/rhzs.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://images.microbadger.com/badges/image/rhzs/nginx-static.svg)](https://microbadger.com/images/rhzs/nginx-static \"Get your own image badge on microbadger.com\") ![](https://img.shields.io/docker/pulls/rhzs/nginx-static.svg)\n\n# Lightweight Nginx Image\n\n`docker run -v /absolute/path/to/serve:/static -p 8080:80 rhzs/nginx-static`\n\nThis command exposes an nginx server on port 8080 which serves the folder `/path/to/serve` from the host.\n\nThe image can only be used for static file serving but has with **less than 4 MB** roughly 1/10 the size of the official nginx image. The running container needs **~1 MB RAM**.\n\n### nginx-static via HTTPS\n\nTo serve your static files over HTTPS you must use another reverse proxy. We recommend [træfik](https://traefik.io/) as a lightweight reverse proxy with docker integration. Do not even try to get HTTPS working with this image only, as it does not contain the nginx ssl module.\n\n### nginx-static with docker-compose\nThis is an example entry for a `docker-compose.yaml`\n```\nversion: '3'\nservices:\n  example.org:\n    image: rhzs/nginx-static\n    container_name: example.org\n    ports:\n      - 8080:80\n    volumes: \n      - /path/to/serve:/static\n```\n\n\n### nginx-static with træfik 2.1\n\nTo use nginx-static with træfik 2.1 add an entry to your services in a docker-compose.yaml. To set up traefik look at this [simple example](https://docs.traefik.io/user-guides/docker-compose/basic-example/). \n\nIn the following example, replace everything contained in \u003cangle brackets\u003e and the domain with your values.\n\n```\nservices:\n  traefik:\n    image: traefik:2.1\n  # Your treafik config.\n    ...\n  example.org:\n    image: rhzs/nginx-static\n    container_name: example.org\n    expose:\n      - 80\n    labels:\n      - \"traefik.enable=true\"\n      - \"traefik.http.routers.\u003crouter\u003e.rule=Host(`example.org`)\"\n      - \"traefik.http.routers.\u003crouter\u003e.entrypoints=\u003centrypoint\u003e\"\n# If you want to enable SSL, uncomment the following line.\n#      - \"traefik.http.routers.\u003crouter\u003e.tls.certresolver=\u003ccertresolver\u003e\"\n    volumes: \n      - /host/path/to/serve:/static\n```\n\nIf traefik and the nginx-static are in distinct docker-compose.yml files, please make sure that they are in the same network.\n\nFor a traefik 1.7 example look [at an old version of the readme](https://github.com/rhzs/docker-nginx-static/blob/bb46250b032d187cab6029a84335099cc9b4cb0e/README.md)\n\n### nginx-static for multi-stage builds\n\nnginx-static is also suitable for multi-stage builds. This is an example Dockerfile for a static nodejs application:\n\n```\nFROM node:alpine\nWORKDIR /usr/src/app\nCOPY . /usr/src/app\nRUN npm install \u0026\u0026 npm run build\n\nFROM rhzs/nginx-static\nRUN apk update \u0026\u0026 apk upgrade\nCOPY --from=0 /usr/src/app/dist /static\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhzs%2Fnginx-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhzs%2Fnginx-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhzs%2Fnginx-static/lists"}