<p>I am new to YAML and I would like to understand the following piece of a .yaml file:</p>
<pre><code>version: &quot;3.7&quot;
services:
    influxdb:
        image: influxdb:alpine
        environment:
            INFLUXDB_DB: ft_services
            INFLUXDB_ADMIN_USER: admin
            INFLUXDB_ADMIN_PASSWORD: admin
        volumes:
            - datainfluxdb:/var/lib/influxdb
        deploy:
            restart_policy:
                condition: on-failure
</code></pre>
<p>As far as I know, there are 3 types of data that can be used in a .yaml file: scalars, sequences and mappings. For example, <code>version: &quot;3.7&quot;</code> is a scalar. But I am not sure what the following are:</p>
<pre><code>volumes:
            - datainfluxdb:/var/lib/influxdb
</code></pre>
<pre><code>environment:
            INFLUXDB_DB: ft_services
            INFLUXDB_ADMIN_USER: admin
            INFLUXDB_ADMIN_PASSWORD: admin
</code></pre>
<p>I don't really understand what type of data are these and how do they work, can someone give me a hint?</p>

kubo
<h2>Lists</h2>
<p>example</p>
<pre><code>volumes:
   - data: /var/lib
     other-field: &quot;example&quot;
   - data: /etc
</code></pre>
<p>Each indented line beginning with an <code>-</code> above is the beginning of a <em>List Item</em>. There is two items in the list in the example and the whole list is named <code>volumes</code>. The example is a List of Maps, but also List of Scalars is valid.</p>
<h2>Maps</h2>
<p>example</p>
<pre><code>environment:
    INFLUXDB_DB: ft_services
    INFLUXDB_ADMIN_USER: admin
    INFLUXDB_ADMIN_PASSWORD: admin
</code></pre>
<p>as you wrote, this is a Map with Key-Value pairs and the whole Map is named <code>environment</code>.</p>
<h2>Scalars</h2>
<p>As you wrote there is also scalars of various types. A value within quotes like <code>&quot;3.7&quot;</code> is a <code>string</code>.</p>
