Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop merging docker compose files #1763

Open
marksteward opened this issue Aug 10, 2024 · 0 comments
Open

Stop merging docker compose files #1763

marksteward opened this issue Aug 10, 2024 · 0 comments

Comments

@marksteward
Copy link
Member

Docker compose merges keys for override files, so these two:

docker-compose.yml:

    volumes:
      - .:/app
      - ./var/vat_invoices:/vat_invoices
    ports:
      - "2342:2342"
    environment:
      SETTINGS_FILE: ./config/development.cfg
      FLASK_APP: dev_server.py
      FLASK_ENV: development
      COLORIZE_LOGS: always
      PYTHONUNBUFFERED: 1
      IRCCAT: fakeirccat:12345

docker-compose.prod.yml:

    ports:
      - "127.0.0.1:8000:8000"
    volumes:
      - /etc/emf-site.cfg:/app/config/production.cfg
      - /etc/emf:/etc/emf
      - /var/lib/emf_vat_invoices:/vat_invoices
...
    environment:
      SETTINGS_FILE: ./config/production.cfg
      IRCCAT: irccat.orga.emfcamp.org:12345

Become:

    ports:
      - "127.0.0.1:8000:8000"
      - "2342:2342"
    volumes:
      - .:/app
      - /etc/emf-site.cfg:/app/config/production.cfg
      - /etc/emf:/etc/emf
      - /var/lib/emf_vat_invoices:/vat_invoices
    environment:
      FLASK_APP: dev_server.py
      FLASK_ENV: development
      COLORIZE_LOGS: always
      PYTHONUNBUFFERED: 1
      SETTINGS_FILE: ./config/production.cfg
      IRCCAT: irccat.orga.emfcamp.org:12345

Sadly, the nice fix, using !override, needs a newer version of docker compose (2.24.4) than we have in prod (2.21.0, on Debian 12). So it might be worth using extends instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant