Note: Docker support is a work in progress. The following instructions may not work exactly as expected across operating systems and environments.
Nmig can run inside a Docker container while connecting to MySQL and PostgreSQL on the host machine.
1. Follow instructions in the "USAGE" section in README.md to:
- Download the Nmig repository.
- Create a PostgreSQL database.
- Edit the necessary files in the
config
directory.
2. Build a Docker image from the nmig
directory.
$ docker build --tag my-migration .
3. Mount the edited config
directory and run Nmig in a new Docker container.
$ docker run --rm \ --mount type=bind,source=/path/to/nmig_config,target=/usr/src/app/config \ my-migration \ npm start
Notes:
- These steps require Docker. Consult the official Docker site for download and installation instructions.
- In configuration files, the
target.host
andsource.host
properties will be"host.docker.internal"
instead of"localhost"
. - The examples above use "my-migration" as the image tag, but it can be any name you choose.