-
Create a parent folder for your Mage project (e.g.
my_team). -
Change directory (e.g.
cd my_team) into the parent folder and start Mage locally: For example:For more examples, read the setup guide. -
Once you’re done developing, copy the contents of the this
Dockerfile template
and paste it into a new
Dockerfilelocated in the parent folder of your Mage project (e.g.my_team/Dockerfile). Replace all instances of the string[project_name]with your project name. For example, if your project name isdemo_project, then your Dockerfile will look like this: The contents of yourDockerfileare: -
Your current folder structure should look like this:
-
Build a custom Docker image using
mageai/mageai:latestas the base and using the newly created Dockerfile as the additional set of instructions:Changemageprodto any other name. You’ll need this tag name when deploying to production in the cloud. -
To test the new image works, run the following command:
-
Open your browser and go to http://localhost:6789/
- You should see all your pipelines there.
- Changing the contents of files won’t change the contents on your local file system because all your code was packaged together within the Docker image (this is intentional).
-
The next steps depends on your deployment method. If you are using
Terraform, then you’ll need to use the previously
tag name (e.g.
mageprod) when pushing a Docker image to a remote Docker registry.