This portion of the file system is writeable, which means that the container can not only read but also write (and delete) files in the host machine.
The /tmp folder of the host's file system is mapped to the /my-volumes/host-volume folder of the container. Materialization is a variable that controls how dbt creates a model. The first section simply specifies which version of the Docker Compose. Step 2 : The docker-compose.yml file we used to launch our multi-container application is split into three separate sections. In this file, you can define the profile to be used and the paths for different types of files (see -paths). Step 1 : Create a directory for the application, and within it, create docker-compose.yml to define the app. The two host volumes, instead, will be available only to volumes-example-service. The profiles.yml file can contain multiple profiles for when you have more than one dbt project. Here, both containers will have read/write access to the my-named-global-volume shared folder, no matter the different paths they've mapped it to. my-named-global-volume:/another-path/the-same-named-global-volume home:/my-volumes/readonly-host-volume:ro
my-named-global-volume:/my-volumes/named-global-volume Before we start defining services in the docker - compose.yml file, we create a network so that containers can communicate. In this last example, we can see that another-service-in-the-same-network will be able to ping and to reach port 80 of network-example-service, while another-service-in-its-own-network won't. At the time of this writing, the latest stable version of docker-compose is 1.25.4, you can choose to substitute 1.25.4 with any other versions you want to install. This powerful mechanism allows us to run different containers exposing the same ports without collisions.įinally, we can define additional virtual networks to segregate our containers: services: Port 80 will now be visible from the host, while port 3000 of the other two containers will be available on ports 80 in the host. To reach a container from the host, the ports must be exposed declaratively through the ports keyword, which also allows us to choose if exposing the port differently in the host: services: In this case, by the way, it would also work without exposing it, because the expose directive is already in the image Dockerfile.