{"id":40969034,"url":"https://github.com/panubo/docker-staticsite","last_synced_at":"2026-01-22T06:34:14.531Z","repository":{"id":44928892,"uuid":"170615020","full_name":"panubo/docker-staticsite","owner":"panubo","description":"Docker image with nginx, awscli and scripts for automated configuration and deployment of static sites","archived":false,"fork":false,"pushed_at":"2026-01-20T04:20:32.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-20T05:50:56.654Z","etag":null,"topics":["aws","cloudfront","devops","docker-image","s3","staticsite"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/panubo/staticsite/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panubo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-14T02:39:30.000Z","updated_at":"2026-01-20T04:20:36.000Z","dependencies_parsed_at":"2024-02-01T05:33:01.283Z","dependency_job_id":"3de58219-4062-4868-9e9c-43e1964fc642","html_url":"https://github.com/panubo/docker-staticsite","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/panubo/docker-staticsite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panubo%2Fdocker-staticsite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panubo%2Fdocker-staticsite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panubo%2Fdocker-staticsite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panubo%2Fdocker-staticsite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panubo","download_url":"https://codeload.github.com/panubo/docker-staticsite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panubo%2Fdocker-staticsite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28656953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["aws","cloudfront","devops","docker-image","s3","staticsite"],"created_at":"2026-01-22T06:34:13.861Z","updated_at":"2026-01-22T06:34:14.526Z","avatar_url":"https://github.com/panubo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static Site\n\n[![build and push on main and tags](https://github.com/panubo/docker-staticsite/workflows/build%20and%20push%20on%20main%20and%20tags/badge.svg)](https://github.com/panubo/docker-staticsite/actions)\n[![Status](https://img.shields.io/badge/status-STABLE-green.svg)]()\n[![release](https://img.shields.io/github/v/release/panubo/docker-staticsite)](https://github.com/panubo/docker-staticsite/releases/latest)\n[![license](https://img.shields.io/github/license/panubo/docker-staticsite)](LICENSE)\n\nMinimal Alpine Linux Docker image with `nginx`, `awscli` and `gomplate`. Also included are scripts for\ndeploying to S3 and templating files.\n\nThis is useful as an intermediate container for holding static website build artefacts. This image can then be used\nas a container for holding a static website. And the resulting image artefact can be used to serve the site, or used to deploy the site to an S3 website bucket, or a bucket backed CloudFront distribution.\n\nThis image is available on quay.io `quay.io/panubo/staticsite` and AWS ECR Public `public.ecr.aws/panubo/staticsite`.\n\n\u003c!-- BEGIN_TOP_PANUBO --\u003e\n\u003e [!IMPORTANT]\n\u003e **Maintained by Panubo** — Cloud Native \u0026 SRE Consultants in Sydney.\n\u003e [Work with us →](https://panubo.com.au)\n\u003c!-- END_TOP_PANUBO --\u003e\n\n## Entrypoint Commands\n\n- `nginx` - Serve static files from `/var/www/html` (default)\n- `s3sync` - Synchronize the files in `/var/www/html` with a S3 bucket (uses awscli)\n- `k8s-init` - Copy all files to volume and template files (intended for a Kubernetes initContainer)\n- `k8s-nginx` - Start nginx only (no rendering, intended to run after `k8s-init`)\n\n## Configuration / Environment Options\n\nFor `nginx` entrypoint:\n\n- `PORT` - server port for nginx to listen on (Default: `8080`)\n- `NGINX_SERVER_ROOT` - server web root (Default: `/var/www/html`)\n- `NGINX_SERVER_INDEX` - server index page(s) (Default: `index.html index.htm`)\n- `NGINX_SINGLE_PAGE_ENABLED` - if set to `true` all requests will be routed through `/$NGINX_SINGLE_PAGE_INDEX`\n- `NGINX_SINGLE_PAGE_INDEX` - When single page mode is enabled, route request to this page (Default: `index.html`)\n\nFor `s3sync` entrypoint:\n\n- `AWS_ACCESS_KEY` - AWS Access Key (optional)\n- `AWS_SECRET_KEY` - AWS Secret Key (optional)\n- `AWS_BUCKET_NAME` - AWS Bucket Name (required).\n- `CACHE_CONTROL_DEFAULT=\"public, max-age=3600\"` - Default Cache-Control header to set (optional).\n- `CACHE_CONTROL_DEFAULT_OVERRIDE=\"public, max-age=60, s-maxage=60\"` - Alternate default Cache-Control header (optional).\n- `CACHE_CONTROL_OVERRIDE_N` - Override the Cache-Control header for a file.\n- `CONTENT_TYPE_OVERRIDE_N` - Override the Cache-Control header for a file.\n\n### Templater\n\nThe templater function runs with both entrypoint commands. Useful for generating `env.js` configuration for dynamically configurable JS apps.\n\nTemplates must be written in [gomplate](https://docs.gomplate.ca/) template syntax. All templates must be written to utilise environment variables as the context data source.\n\n- `RENDER_TEMPLATE_N` - full path to template file to render. If template ends in `.tmpl` it will be removed from the output file.\n\n### Deployfile\n\nAdditional entrypoint pre-commands or post-commands can be specified in a `Deployfile.pre` and/or `Deployfile.post`.\n\n- `DEPLOYFILE_PRE` - Pre Deployfile location, (Default: `/Deployfile.pre`)\n- `DEPLOYFILE_POST` - Post Deployfile location, (Default: `/Deployfile.post`)\n- `RUN_DEPLOYFILE_COMMANDS` - Set to `true` to enable this functionality.\n\nNotes:\n\n* When running `nginx` command, only the `DEPLOYFILE_PRE` is able to execute.\n* Pre and post Deployfile is disabled for the `k8s-*` entrypoints\n\n### Special file names\n\nApart from the case when the app is configured with `NGINX_SINGLE_PAGE_ENABLED=true` and `NGINX_SINGLE_PAGE_INDEX=spa.html` which would route all unfilfiled requests to the SPA file,\n`404.html` is used as a default 404 handler\n\n### Cache Control Override\n\n`CACHE_CONTROL_OVERRIDE_N` can be defined as `FILE:VALUE` eg. `index.html:public max-age=30`. If `VALUE` is exclude the `CACHE_CONTROL_DEFAULT_OVERRIDE` is used. Multiple overrides can be set by changing `_N`. Can be replaced with any alphanumeric value eg `CACHE_CONTROL_OVERRIDE_INDEX` and `CACHE_CONTROL_OVERRIDE_404`.\n\n**See known issues**\n\n### Control Type Override\n\n`CONTENT_TYPE_OVERRIDE_N` can be defined as `FILE:VALUE` eg. `mydatafile:application/json`. Multiple overrides can be set by changing `_N`. Can be replaced with any alphanumeric value eg `CONTENT_TYPE_OVERRIDE_INDEX` and `CONTENT_TYPE_OVERRIDE_404`.\n\n**See known issues**\n\n## Usage Examples\n\nSee [docs](./docs/) for usage examples.\n\n## v0.4.0 Upgrade **BREAKING CHANGES**\n\nThere are two main breaking changes includes in the v0.4.0 release.\n\n**Run as non-root**\n\nThe image is setup to be run as non-root. This requires any content added to the image be owned by the `nginx` user. This can be achieved with one of the following methods.\n\nUsing `COPY --chown=nginx:nginx . /var/www/html` (recommended)\n\nOr, using\n\n```\nUSER root\nRUN chown -R nginx:nginx /var/www/html\nUSER nginx\n```\n\nAlternatively this change can be simply reverted by adding `USER root` to your downstream image.\n\n**Change nginx port to 8080**\n\nPreviously nginx listened on port `80` however this is considered a privileged port, the image now defaults to listening on port `8080`. This can be overridden by setting the env var `PORT=80`.\n\n### Known issues\n\n* Setting both cache control override and content type override may result in unexpected behaviour.\n\n### TODO\n\n* Implement similar Cache-Control functionality for Nginx hosted static sites.\n\n## Status\n\nThis is used for deploying production sites.\n\n\u003c!-- BEGIN_BOTTOM_PANUBO --\u003e\n\u003e [!IMPORTANT]\n\u003e ## About Panubo\n\u003e\n\u003e This project is maintained by Panubo, a technology consultancy based in Sydney, Australia. We build reliable, scalable systems and help teams master the cloud-native ecosystem.\n\u003e\n\u003e We are available for hire to help with:\n\u003e\n\u003e * SRE \u0026 Operations: Improving system reliability and incident response.\n\u003e * Platform Engineering: Building internal developer platforms that scale.\n\u003e * Kubernetes: Cluster design, security auditing, and migrations.\n\u003e * DevOps: Streamlining CI/CD pipelines and developer experience.\n\u003e * [See our other services](https://panubo.com.au/services)\n\u003e\n\u003e Need a hand with your infrastructure? [Let’s have a chat](https://panubo.com.au/contact) or email us at team@panubo.com.\n\u003c!-- END_BOTTOM_PANUBO --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanubo%2Fdocker-staticsite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanubo%2Fdocker-staticsite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanubo%2Fdocker-staticsite/lists"}