You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The port which runs your application inside Docker container is either configured as `PORT` property in your `.env` configuration file or passed to Docker container via environment variable `PORT`. Default port is `3000`.
389
+
388
390
#### Run image in detached mode
389
391
390
392
```shell
@@ -415,6 +417,39 @@ docker images
415
417
416
418
Go to console and press <CTRL> + C at any time.
417
419
420
+
### Docker environment variables
421
+
422
+
There are several options to configure your app inside a Docker container
423
+
424
+
#### project .env file
425
+
426
+
You can use `.env` file in project root folder which will be copied inside Docker image. If you want to change a property inside `.env` you have to rebuild your Docker image.
427
+
428
+
#### run options
429
+
430
+
You can also change app configuration by passing environment variables via `dockerrun` option `-e` or `--env`.
431
+
432
+
```shell
433
+
dockerrun--env DB_HOST=localhost-eDB_PORT=3306
434
+
```
435
+
436
+
#### environment file
437
+
438
+
Last but not least you can pass a config file to `dockerrun`.
0 commit comments