Skip to content

Commit 91ffb01

Browse files
committed
chore: add instructions on how to use the bind mounts to avoid rebuilding the container everytime the settings.ts file change
1 parent 03896bc commit 91ffb01

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ If you want to let it run in the background (detached mode), just use the follow
5454

5555
1. `docker run -d node-gitlab-2-github:latest`
5656

57+
### Docker with bind mounts
58+
59+
In order to optimize the usage of the dockerized application, one can use the `bind mounts` feature of Docker ([Docker docs](https://docs.docker.com/storage/bind-mounts/)). This way, whenever you change the `settings.ts` file in the host environment it will change in the container filesystem as well.
60+
61+
The process to use this trick is pretty much the same we presented before, the only different is the addition of a flag in the docker command to tell it what is the directory/file to be bound.
62+
63+
1. Make sure that you have [Docker](https://docs.docker.com/engine/install/) installed in your computer. You can test running `docker version` in the terminal.
64+
1. `cp sample_settings.ts settings.ts`
65+
1. edit settings.ts
66+
1. `docker build -t node-gitlab-2-github:latest .`
67+
1. This command must work for **Linux** or **Mac**: `docker run --mount type=bind,source="$(pwd)/settings.ts",target="/app/settings.ts",readonly node-gitlab-2-github:latest`
68+
69+
* If you want to run this last command in the Windows environment, please consult the Docker documentation on how to solve the problem of the pwd command expanding incorrectly there - [Docker documentation - Topics for windows](https://docs.docker.com/desktop/troubleshoot/topics/#topics-for-windows).
70+
5771
## Where to find info for the `settings.ts`
5872

5973
### gitlab

0 commit comments

Comments
 (0)