{"id":21880892,"url":"https://github.com/maslick/angularchik","last_synced_at":"2026-04-11T02:03:56.191Z","repository":{"id":38658244,"uuid":"220852175","full_name":"maslick/angularchik","owner":"maslick","description":"runtime-configurable static angular web-app","archived":false,"fork":false,"pushed_at":"2023-01-01T13:21:14.000Z","size":3776,"stargazers_count":1,"open_issues_count":26,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T18:47:44.221Z","etag":null,"topics":["angular","docker","k8s","nginx","npm"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/maslick.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}},"created_at":"2019-11-10T21:14:04.000Z","updated_at":"2020-01-03T08:57:55.000Z","dependencies_parsed_at":"2023-01-31T22:46:13.310Z","dependency_job_id":null,"html_url":"https://github.com/maslick/angularchik","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maslick%2Fangularchik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maslick%2Fangularchik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maslick%2Fangularchik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maslick%2Fangularchik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maslick","download_url":"https://codeload.github.com/maslick/angularchik/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890107,"owners_count":20527031,"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","k8s","nginx","npm"],"created_at":"2024-11-28T09:16:49.437Z","updated_at":"2026-04-11T02:03:56.138Z","avatar_url":"https://github.com/maslick.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-chik\nruntime-configurable static angular web-app\n\n[![image size](https://img.shields.io/badge/image%20size-49MB-blue.svg)](https://hub.docker.com/r/maslick/angularchik)\n\n## Docker multistage build\n[Here](docker/Dockerfile) I'm using ``node:12`` image as build image and ``nginx:stable`` as runtime image. This reduces image size from ~500MB to 50MB (zipped).\n\n* Build yourself:\n```zsh\ndocker build -t angularchik -f docker/Dockerfile .\ndocker image prune --filter label=stage=intermediate -f\ndocker run -d \\\n   -e URL=maslick.io \\\n   -e USER=test \\\n   -e KEY=54321 \\\n   -p 8081:8080 \\\n   angularchik:latest\nopen http://`docker-machine ip`:8081\n```\n\n* Download from Dockerhub: \n```zsh\ndocker run -d \\\n   -e URL=maslick.ru \\\n   -e USER=test \\\n   -e KEY=12345 \\\n   -p 8082:8080 \\\n   maslick/angularchik:latest\nopen http://`docker-machine ip`:8082\n```\n\n## Kubernetes\n```\nkubectl apply -f k8s/deployment.yaml\nkubectl apply -f k8s/ingress_dns.yaml\n```\n\n* Update environment settings:\n```\nk set env deployment/angularchik \\\n   URL=www.yandex.ru \\\n   USER=maslick \\\n   KEY=987654321\n```\n\n## Use in your projects\n* Add env variable names to variables.ini, e.g.:\n```zsh\n$ cat docker/variables.ini\nURL\nUSER\nKEY\n```\n\n* Add this code snippet to your main index.html (put in to ``\u003cheader\u003e\u003c/header\u003e``):\n```html\n\u003cscript\u003e\n  window.ENV = {\n      backendUrl: \"${URL}\",\n      user: \"${USER}\",\n      key: \"${KEY}\"\n  };\n\u003c/script\u003e\n``` \n\n* Add an environment file:\n```zsh\n$ cat src/environments/runtimeEnvironment.ts\ndeclare var ENV;\n\nexport const runtimeEnvironment = {\n  backendUrl: ENV.backendUrl === '${URL}' ? 'www.google.com' : ENV.backendUrl,\n  user: ENV.user === '${USER}' ? 'user' : ENV.user,\n  key: ENV.key === '${KEY}' ? '12345' : ENV.key\n};\n```\n\n* Use the injected env vars in your code (see [settings.component.ts](src/app/settings/settings.component.ts) for a complete example):\n```typescript\nimport { runtimeEnvironment } from '@env/environment.runtime';\nconsole.log(runtimeEnvironment.backendUrl);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaslick%2Fangularchik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaslick%2Fangularchik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaslick%2Fangularchik/lists"}