title: Angular Docker Runtime Environments
body: <p>I have an <strong>angular</strong> app, which runs with nginx in a docker container. The docker image is publish in a private docker hub. Now I want to pass the environments from docker to <strong>compiled</strong> angular application. At time I create a <code>config.json</code> and a <code>ConfigService</code>, which reads out the file. The file can be change over docker volume. Unfortunately, I have no idea how to use the environment variable in the module.</p>
  
  <pre><code>@NgModule({
    imports: [
      ...
      AgmCoreModule.forRoot({
        apiKey: environment.system.googleMaps.apiKey // old way
      }),
      ...
    ],
    declarations: [
      ...
    ],
    providers: [
      ...
      ConfigService
      ...
    ]
  })
  export class ContractsModule {}
  </code></pre>
  
  <p>Besides, it is only a workaround. Perfect would be to use the docker environment. Have some an idea?</p>
  
  <p>I think this is a good way: <a href="https://stackoverflow.com/a/49349963/8581092">https://stackoverflow.com/a/49349963/8581092</a>.</p>