{"id":23250791,"url":"https://github.com/changhuixu/angular-nginx-docker","last_synced_at":"2025-08-20T09:30:59.866Z","repository":{"id":39132278,"uuid":"262450950","full_name":"changhuixu/angular-nginx-docker","owner":"changhuixu","description":"Serve a SPA using NGINX in a docker container","archived":false,"fork":false,"pushed_at":"2023-01-06T05:22:09.000Z","size":2791,"stargazers_count":6,"open_issues_count":17,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-01T18:25:47.170Z","etag":null,"topics":["angular","docker","nginx","nginx-docker","nginx-server","server","spa","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/changhuixu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"changhuixu","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-08T23:45:27.000Z","updated_at":"2021-11-02T02:40:33.000Z","dependencies_parsed_at":"2023-02-05T10:05:16.778Z","dependency_job_id":null,"html_url":"https://github.com/changhuixu/angular-nginx-docker","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changhuixu%2Fangular-nginx-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changhuixu%2Fangular-nginx-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changhuixu%2Fangular-nginx-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changhuixu%2Fangular-nginx-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/changhuixu","download_url":"https://codeload.github.com/changhuixu/angular-nginx-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408177,"owners_count":18220975,"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":["angular","docker","nginx","nginx-docker","nginx-server","server","spa","web"],"created_at":"2024-12-19T09:15:08.932Z","updated_at":"2024-12-19T09:15:09.653Z","avatar_url":"https://github.com/changhuixu.png","language":"TypeScript","readme":"# Get Started with NGINX on Docker\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I3I63W4OK)\n\nHow to deploy a single-page app with NGINX in a docker container?\n\n## [Medium Article](https://codeburst.io/get-started-with-nginx-on-docker-907e5c0c9f3a)\n\nIn this introductory article, we will use NGINX to server a Single-Page Application (SPA). We will set up and play with NGINX on docker, including (1) serving a website by mounting a volume to a docker container, and (2) building and running a docker image with a web app and NGINX.\n\n---\n\n```bash\nng new angular-nginx-docker --minimal\n\n# build a docker image\ndocker build -t angular-nginx-docker .\n\ndocker run -d -p 80:80 angular-nginx-docker\ndocker run -it -p 80:80  angular-nginx-docker\ndocker exec -it angular-nginx-docker /bin/sh\n```\n\n```bash\n# run the default nginx website in a container\ndocker run --name docker-nginx -p 80:80 nginx\n\n# navigate the nginx files in the docker alpine image\ndocker run -it nginx:alpine sh\n# navigate the nginx files in the docker image\ndocker run -it --name nginx-container -P nginx bash\nroot@805435da60f9:/# cd etc/nginx/\n\n```\n\n```bash\nng build --prod\n\ndocker run -it --rm -p 80:80 \\\n    -v /$PWD/dist/angular-nginx-docker://usr/share/nginx/html:ro \\\n    nginx:alpine\n\ndocker run -it --rm -p 4200:80 \\\n    -v /$PWD/dist/angular-nginx-docker://usr/share/nginx/html:ro \\\n    -v /$PWD/.nginx/nginx.conf://etc/nginx/nginx.conf:ro \\\n    nginx:alpine\n\n```\n\n```bash\n# compare gzip effect using the following two commands\n\n$ curl http://localhost:80/ \\\n    --silent \\\n    --write-out \"%{size_download}\\n\" \\\n    --output /dev/null\n# console output: 814\n\n$ curl http://localhost:80/ \\\n    --silent \\\n    -H \"Accept-Encoding: gzip,deflate\" \\\n    --write-out \"%{size_download}\\n\" \\\n    --output /dev/null\n# console output: 391\n```\n\n## License\n\nFeel free to use the code in this repository as it is under MIT license.\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I3I63W4OK)\n","funding_links":["https://ko-fi.com/changhuixu","https://ko-fi.com/I3I63W4OK"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanghuixu%2Fangular-nginx-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchanghuixu%2Fangular-nginx-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanghuixu%2Fangular-nginx-docker/lists"}