12 Comments
User's avatar
Michael Reed's avatar

For this to work, you have to update the docker-compose.yaml file. If you just keep the one from lesson 1, it will just execute lesson 1's service. See the update to the docker-compose.yml file in the github repo.

System Design Course's avatar

Thanks for the feedback. I will take a look, Please post your observations to the chat. To access it easily

Michael Reed's avatar

Ah I realize this lesson was supposed to stand alone -not be added to the same repo as lesson 1. In that case, as long as you remember to get the docker-compose.yml from the "day 2" folder, you're good to go.

But if you just add the code to the "Day 1" folder, you can get both services up and running simultaneously, which is a nice way to learn about docker-compose.

System Design Course's avatar

Valid Point. I will add short guides for each of the technology usage later separately, for ex. Docker. I wanted full focus to be on System Development for these lessons.

Yaz Kay's avatar

Background: The original post highlights creating a directory named src via the commands:

mkdir -p src/services/log-generator

cd src/services/log-generator

Challenge/Problem: Upon following all instructions and running docker-compose up --build, "it gives a unable to prepare context error"

Solution/Recommendation: Update Day 2 documentation to first create a root folder named "log-generator". The "src"folder has to be placed inside the "log-generator" folder

mkdir log-generator

cd log-generator

System Design Course's avatar

Please post query to the chat.

Aman Saran's avatar

all of the GitHub links on this page appear to be broken/removed

System Design Course's avatar

Hi Aman, Thanks for letting us know, fixed it.

Rishab's avatar

Day 2 git hub code doesnt seem to be correct. It has multiple missing points in the homework.

Rishab's avatar

Will the final Docker-compose file look something like the below after completion of homework of Day 3.

version: '3'

services:

logger:

build:

context: ./src/services/logger

volumes:

- ./src/services/logger:/app

- ./logs:/logs # Mount a volume for persistent logs

ports:

- "8000:8000" # Original port

- "8080:8080" # Web interface port

environment:

- LOG_LEVEL=INFO

- LOG_FREQUENCY=5.0

- LOG_TO_FILE=true

- LOG_FILE_PATH=/logs/logger.log

- LOG_MAX_SIZE_MB=1.0

- WEB_HOST=0.0.0.0

- WEB_PORT=8080

- MAX_LOGS_TO_DISPLAY=100

log-generator:

build:

context: ./src/services/log-generator

volumes:

- ./src/services/log-generator:/app

- ./logs:/logs

environment:

- LOG_RATE=10

- CONSOLE_OUTPUT=true

- OUTPUT_FILE=/logs/generated_logs.log

- LOG_FORMAT=json

- ENABLE_BURSTS=true

- BURST_FREQUENCY=0.1

- BURST_MULTIPLIER=5

- BURST_DURATION=3