From 899e4dfb9a6232c4178653ec47d81928028163a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Fri, 10 Jan 2020 10:55:08 +0100 Subject: [PATCH] Upgrade to v3.7 for docker-compose service definition We were encountering issues when overriding service definitions with "x-...". These were solved by upgrading docker-compose and switching to 3.7 service definition. As a consequence, the minimum supported docker version is 18.06.0, as specified by https://docs.docker.com/compose/compose-file/#compose-and-docker-compatibility-matrix --- CHANGELOG.md | 3 ++- docs/install.rst | 2 +- tutor/templates/dev/docker-compose.yml | 24 ++++++++++++------------ tutor/templates/local/docker-compose.yml | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faa1b2a..95bef1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Improvement] Upgrade to the 3.7 docker-compose syntax - [Improvement] The `dev runserver` command can now be run for just any service -- 💥[Feature] `dev run/exec` commands now support generic options which are passed to docker-compose. Consequently, defining the `TUTOR_EDX_PLATFORM_PATH` environment variable no longer works. Instead, users are encouraged to explicitely pass the `-v` option or define a command alias. +- 💥[Feature] `dev run/exec` commands now support generic options which are passed to docker-compose. Consequently, defining the `TUTOR_EDX_PLATFORM_PATH` environment variable no longer works. Instead, users are encouraged to explicitely pass the `-v` option or define a command alias ## 3.9.1 (2020-01-08) diff --git a/docs/install.rst b/docs/install.rst index 4728a04..671d4be 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -8,7 +8,7 @@ Requirements The only prerequisite for running this is a working docker installation. Both docker and docker-compose are required. Follow the instructions from the official documentation: -- `Docker `_ +- `Docker `_: minimum supported version is 18.06.0. - `Docker compose `_ ⚠️ Warning: do not attempt to simply run ``apt-get install docker docker-compose`` on older Ubuntu platforms, such as 16.04 (Xenial), as you will get older versions of these utilities. diff --git a/tutor/templates/dev/docker-compose.yml b/tutor/templates/dev/docker-compose.yml index 73cf09a..ec5ac06 100644 --- a/tutor/templates/dev/docker-compose.yml +++ b/tutor/templates/dev/docker-compose.yml @@ -1,17 +1,17 @@ -version: "3" +version: "3.7" + +x-openedx-service: + &openedx-service + image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX_DEV }} + environment: + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.development} + volumes: + # theme files + - ../build/openedx/themes:/openedx/themes + # editable requirements + - ../build/openedx/requirements:/openedx/requirements services: - x-openedx-service: - &openedx-service - image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX_DEV }} - environment: - SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.development} - volumes: - # theme files - - ../build/openedx/themes:/openedx/themes - # editable requirements - - ../build/openedx/requirements:/openedx/requirements - lms: <<: *openedx-service command: ./manage.py lms runserver 0.0.0.0:8000 diff --git a/tutor/templates/local/docker-compose.yml b/tutor/templates/local/docker-compose.yml index d155534..b12e20a 100644 --- a/tutor/templates/local/docker-compose.yml +++ b/tutor/templates/local/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.7" services: ############# External services