Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 1.37 KB

DOCKER.md

File metadata and controls

30 lines (26 loc) · 1.37 KB

Note: Docker support is a work in progress. The following instructions may not work exactly as expected across operating systems and environments.

RUNNING WITH DOCKER

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:

  1. Download the Nmig repository.
  2. Create a PostgreSQL database.
  3. 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 and source.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.