{"id":20332637,"url":"https://github.com/socialengine/docker-nginx-spa","last_synced_at":"2025-06-11T21:06:17.792Z","repository":{"id":79300489,"uuid":"49618650","full_name":"SocialEngine/docker-nginx-spa","owner":"SocialEngine","description":"Docker image used to serve a Single Page App (pure frontend javascript) using nginx, it support PushState, and includes a way to pass configuration at run time.","archived":false,"fork":false,"pushed_at":"2019-10-02T21:31:02.000Z","size":5,"stargazers_count":71,"open_issues_count":2,"forks_count":36,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-28T06:15:26.981Z","etag":null,"topics":[],"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/SocialEngine.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":"2016-01-14T03:01:17.000Z","updated_at":"2024-06-11T13:51:13.000Z","dependencies_parsed_at":"2023-03-12T07:39:19.166Z","dependency_job_id":null,"html_url":"https://github.com/SocialEngine/docker-nginx-spa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SocialEngine/docker-nginx-spa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fdocker-nginx-spa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fdocker-nginx-spa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fdocker-nginx-spa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fdocker-nginx-spa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SocialEngine","download_url":"https://codeload.github.com/SocialEngine/docker-nginx-spa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fdocker-nginx-spa/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259340581,"owners_count":22843023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-14T20:27:37.578Z","updated_at":"2025-06-11T21:06:17.765Z","avatar_url":"https://github.com/SocialEngine.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![docker pull socialengine/nginx-spa][image shield]][docker hub]\n\nThis is a Docker image used to serve a Single Page App (pure frontend javascript) using nginx, it support PushState, and includes a way to pass configuration at run time.\n\n## Supported tags and `Dockerfile` links\n\n-\t[`latest` (*Dockerfile*)][latest]\n\n## Included on top of [base][base image] nginx image\n\n- [pushState][push state] support. Every request is routed to `/app/index.html`. Useful for the clean urls (no `!#`)\n- [ENV-based Config](#env-config)\n\n# App Setup\n\nThis docker image is built for `index.html` file being in the `/app` directory. `pushState` is enabled.\n\nAt a minimum, you will want this in your `Dockerfile`:\n\n```Dockerfile\nFROM socialengine/nginx-spa\n\nCOPY build/ /app\nCOPY index.html /app/index.html\n```\n\nThen you can build \u0026 run your app in the docker container. It will be served by a nginx static server.\n\n```bash\n$ docker build -t your-app-image .\n$ docker run -e API_KEY=yourkey -e API_URL=http://myapi.example.com \\\n  -e CONFIG_VARS=API_URL,API_KEY -p 8000:80 your-app-image\n```\n\nYou can then go to `http://docker-ip:8000/` to see it in action.\n\n## Env Config\n\nIncluded is ability to pass `run` time environmental variables to your app.\n\nThis is very useful in case your API is on a different domain, or if you want to configure central error logging. \n\n```bash\n$ docker run -e RAVEN_DSN=yourkey -e API_URL=http://myapi.example.com  \\\n  -e CONFIG_VARS=API_URL,RAVEN_DSN -p 8000:80 socialengine/nginx-spa:latest\n ==\u003e Writing /app/config.js with {\"RAVEN_DSN\":\"yourkey\", \"API_URL\":\"http://myapi.example.com\"}\n```\n\nThis will create a `config.js` file, which you can then add to your index.html, or load asynchronously. The path can be controlled with `CONFIG_FILE_PATH` environmental variable.\n\n[push state]: https://developer.mozilla.org/en-US/docs/Web/API/History_API\n[latest]: https://github.com/SocialEngine/docker-nginx-spa/blob/master/Dockerfile\n[base image]: https://github.com/nginxinc/docker-nginx\n[image shield]: https://img.shields.io/badge/dockerhub-socialengine%2Fnginx--spa-blue.svg\n[docker hub]: https://registry.hub.docker.com/u/socialengine/nginx-spa/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialengine%2Fdocker-nginx-spa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocialengine%2Fdocker-nginx-spa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialengine%2Fdocker-nginx-spa/lists"}