Getting started with Docker and NixOS
As an experimental feature, Docker and Nix are available within Projects. You can run and build images to run containers inside your project by opening a terminal and running
docker. If you have a
docker-compose file in your root folder you have to run only
docker-compose up and that's all, all your services will run within Projects.
In addition, Nix is also supported. Nix is a tool that takes a unique approach to package management and system configuration. Basically, you can install any additional tool, like java or Node v16, in your OS.
If you run a development server for example inside the container and it opens up a port then Projects will detect that automatically and make the preview available. You can open the preview from the Other Previews in this case.
5. If you would like to start the given container every time you create a new branch or even restart your projects then you can persist it as a task
If you define it as a task you will be able to run the container from the UI. You can also put it under setupTask and in this case the container will start when you create a workspace next time.
Tip: Commit your changes and add the configuration to your repository so Projects will be able to run the container for every newly created branch.