From e8d916920c4df6633abce8733f128fb1c5dc646c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Fri, 27 Apr 2018 19:07:02 +0200 Subject: [PATCH] Do not build nginx image Instead, just import the base image and customise it with volumes. --- .gitignore | 2 +- config/rendered/nginx/.gitignore | 0 .../templates => config/templates/nginx}/cms.conf.templ | 0 .../templates => config/templates/nginx}/lms.conf.templ | 0 configure | 8 ++++---- docker-compose.yml | 4 ++-- nginx/Dockerfile | 6 ------ 7 files changed, 7 insertions(+), 13 deletions(-) create mode 100644 config/rendered/nginx/.gitignore rename {nginx/config/templates => config/templates/nginx}/cms.conf.templ (100%) rename {nginx/config/templates => config/templates/nginx}/lms.conf.templ (100%) delete mode 100644 nginx/Dockerfile diff --git a/.gitignore b/.gitignore index 5bcd683..4100e1d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ config.json openedx/config/*.env.json openedx/config/*.auth.json -nginx/config/*.conf +config/rendered/nginx/*.conf mysql/config/database mysql/config/username mysql/config/password diff --git a/config/rendered/nginx/.gitignore b/config/rendered/nginx/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/nginx/config/templates/cms.conf.templ b/config/templates/nginx/cms.conf.templ similarity index 100% rename from nginx/config/templates/cms.conf.templ rename to config/templates/nginx/cms.conf.templ diff --git a/nginx/config/templates/lms.conf.templ b/config/templates/nginx/lms.conf.templ similarity index 100% rename from nginx/config/templates/lms.conf.templ rename to config/templates/nginx/lms.conf.templ diff --git a/configure b/configure index 16ae24b..0dd7f7e 100755 --- a/configure +++ b/configure @@ -174,13 +174,13 @@ def main(): # We need a different delimiter in nginx config files, because the '$' sign # is widely used there substitute( - os.path.join('nginx', 'config', 'templates', 'lms.conf.templ'), - os.path.join('nginx', 'config', 'lms.conf'), + os.path.join('config', 'templates', 'nginx', 'lms.conf.templ'), + os.path.join('config', 'rendered', 'nginx', 'lms.conf'), delimiter='£', **configurator.as_dict() ) substitute( - os.path.join('nginx', 'config', 'templates', 'cms.conf.templ'), - os.path.join('nginx', 'config', 'cms.conf'), + os.path.join('config', 'templates', 'nginx', 'cms.conf.templ'), + os.path.join('config', 'rendered', 'nginx', 'cms.conf'), delimiter='£', **configurator.as_dict() ) diff --git a/docker-compose.yml b/docker-compose.yml index 5108e4c..25c163f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,12 +30,12 @@ services: MYSQL_ROOT_PASSWORD_FILE: /etc/mysql/conf.d/openedx/password nginx: - build: - context: ./nginx + image: nginx:1.13 restart: unless-stopped ports: - "80:80" volumes: + - ./config/rendered/nginx:/etc/nginx/conf.d/ - ./data/lms:/openedx/data/lms:ro - ./data/cms:/openedx/data/cms:ro diff --git a/nginx/Dockerfile b/nginx/Dockerfile deleted file mode 100644 index 9a15680..0000000 --- a/nginx/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM nginx:1.13 -VOLUME /openedx/data/lms -VOLUME /openedx/data/cms - -COPY ./config/lms.conf /etc/nginx/conf.d/lms.conf -COPY ./config/cms.conf /etc/nginx/conf.d/cms.conf