Skip to content

Refactor Request: Improve Maintainability of Redundant Docker Compose (OpenAI) #66

Description

@bijoy26

Issue

IMHO, the docker-compose-openai.yaml (introduced in #32) is not easy to comprehend at one go. It repeats the same environment and build configurations across 12 services. This impacts readability, maintainability and updates (error-prone) to a high margin for lab maintainers & students.

Proposed Change

It can be refactored using Compose Fragments (YAML anchors and aliases) to centralize shared configuration into a single template, ensuring consistency across all lab instances. This should reduce the file size by ~70%.

Example:

x-chat-base: &chat-base
  build: ...
  environment: ...

services:
  chat-copilot-1:
    <<: *chat-base
    ports: ["127.0.0.1:4001:4000"]
    volumes: [...]

I'd be happy to file a PR to improve the maintainability of these labs.

Unlike docker-compose.yaml, I'm hoping this variant isn't py generated 🤞, unless the change needs to take place in the generator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions