Question 1 · easy
What is a service, as this lesson defines it?
A service keeps running and answers whoever asks, like a tea stall that stays open. The notice board is two services: the API on port 8000 and PostgreSQL.
Free lesson · Module 1, lesson 7 of 7
Start the notice board and its database with one command, post and list a notice with curl, and say why "it runs on my laptop" is where DevOps starts.
A service is a program that keeps running and answers on a port. The notice board is two of them, an API and a PostgreSQL database, each in its own container, started together by Docker Compose with one command. Work in ~/cloud-devops.
api: the notice board, on localhost:8000db: PostgreSQL 18.7, published only on 127.0.0.1:55432, for tools on your laptop; the API reaches it as db:5432quickstart/compose.yaml starts both, the database first; make up runs it.env holds your settings: make up copies it from .env.example the first time, and it is never committed. The notices password in it is a harmless value for a database on your own laptopmake up: builds, starts db and api, waits until both are healthy, loads the 12 seed notices (the first time takes a few minutes for downloads)make ps: db and api both up and (healthy)curl -s localhost:8000/health prints {"status":"ok","database":"ok"}curl -s -X POST localhost:8000/notices -d @labs/m01/notice.json -H 'content-type: application/json' answers 201 with your notice, id 13: "Library reading room hours", open 8 am to 10 pm from 30 November to 19 December 2026curl -s localhost:8000/notices | jq length prints 13: 12 seed notices and yours{"status":"degraded","database":"down"} (503) means the API runs but cannot reach the database: make ps, then make logscontent-type header the POST answers 422, and its detail reads Input should be a valid dictionary or object to extract fields from: the body was not read as JSONmake up again skips seed notices already there; make logs follows the API's log lines; make down stops the stack and keeps the datamake ps firstpostgres:18.7, python:3.14.10-slim) and the same setting names (.env.example) make it run the same on every laptop. Running on yours is the first proof; the rest of the course carries it to every other machinelocalhost:8000/notices/13bash labs/m01/check.shOK healthChecked in your browser. Nothing is sent or saved.
5 questions
Question 1 · easy
What is a service, as this lesson defines it?
A service keeps running and answers whoever asks, like a tea stall that stays open. The notice board is two services: the API on port 8000 and PostgreSQL.
Question 2 · medium
make up loaded the 12 seed notices. Priya posts two notices of her own, then runs curl -s localhost:8000/notices | jq length. What prints?
The notices route lists every notice in the shared database: 12 seeded plus her 2 is 14. Counting only her own is the common slip.
Question 3 · medium
curl -s localhost:8000/health prints {"status":"degraded","database":"down"}. Which part is broken?
Something answered, so the API is running; a dead API would not answer at all. Degraded with database down (503) points at PostgreSQL: run make ps, then make logs.
Question 4 · medium
Asha posts labs/m01/notice.json without the content-type header. The board answers 422, and the detail reads Input should be a valid dictionary or object to extract fields from. What is the fix?
A 4xx means the request was wrong, not the server. Without the header curl labels the body as form data, so the board never reads it as JSON. With the header the post answers 201.
Question 5 · hard
Arjun has the project too. What makes it run the same on his laptop as on Sameer's?
A zip carries the code but not which Python, which database or which settings, and that is what breaks on demo day. Pinned versions and the same setting names, all from the repository, make every laptop build the same thing.
The pass mark is 4 of 5 right.
Look at these again, each with its explanation:
Your answers stay in this browser tab. Nothing is sent or saved.
Setting up: Linux or WSL2, Docker and Git on an 8 GB laptopThat was the free module. Tell me when the course opens
You are offline. Pages you opened before still open; forms, sign-in, payments and videos need a connection.