DevOps Classroom notes 18/Dec/2025

YAML

  • This is Data description language.
  • YAML uses name-value (key value) just like json
  • Value can be of different forms
    • simple
      • text
      • number
      • boolean
    • complex
      • list/array (plural)
      • map/object
  • syntax: YAML is heavily inspired by python (indentation) <name>: <value>
    • text: name: Avatar Fire and Ash
    • number: runtime: 197
    • boolean: imax: True or imax: yes
    • list:
      “`yaml
      story:</li>
      <li>James Cameron</li>
      <li>Amanda Silver</li>
      <li>Josh Friedman
      “`
    • map/object
      yaml
      cast:
      hero: Jake sully
      heroin: Neytri
  • Yaml files generally created with extensions .yaml or .yml
---
name: Avatar Fire and Ash
runtime: 197
director: James Cameron
imax: yes
story:
  - James Cameron
  - Amanda Silver
  - Josh Friedman
cast:
  hero: Jake sully
  heroin: Neytri
  • Use any yaml validator Refer Here
  • When we use yaml as an input to some tool, they would have defined schema.

Docker compose yaml file

  • Compose file gives a reference Refer Here
  • services are containers
  • This will start postgres database and pgadmin
  • I want both of them running a same network
  • postgres container requires a volume
  • postgres container will run of 5432 and pgamin will be hosted on 80 which will be mapped to 9080
  • create a file called docker-compose.yml
---
services:
  pgadmin:
    image: dpage/pgadmin4
    networks:
      - pg-net
    environment:
      - PGADMIN_DEFAULT_EMAIL=admin@example.com
      - PGADMIN_DEFAULT_PASSWORD=admin123
    ports:
      - "32780:80"
    depends_on:
      - db
  db:
    image: postgres:16
    networks:
      - pg-net
    environment:
      - POSTGRES_DB=appdb
      - POSTGRES_USER=appuser
      - POSTGRES_PASSWORD=apppassword
    volumes:
      - pgdata:/var/lib/postgresql/data
networks:
  pg-net:
    name: pg-net
    driver: bridge

volumes:
  pgdata:
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%