From cb26d78d366cf63d81581a3683828c9ed2aa76bf Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Thu, 24 Nov 2022 05:06:17 +0900 Subject: [PATCH] Use repository root as build context in docker-compose This fixes the issue where `docker-compose` fails to build takahe:latest container. The cause of issue is the build context for docker compose is different from the one of `docker build`. Currently, `make image` uses the repository root as a build context while `make compose_up` will use `docker/` directory as a build context. That's why docker-compose couldn't find the required files during building. --- docker/docker-compose.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index fa1346f..cacbdab 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -6,7 +6,10 @@ version: "3.4" x-takahe-common: &takahe-common - build: . + build: + context: .. + dockerfile: ./docker/Dockerfile + image: takahe:latest environment: DJANGO_SETTINGS_MODULE: takahe.settings.development