From 4161e3f89c8acad6d1202d21f4f6fee4430b93c3 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 17 Sep 2023 19:24:39 +0800 Subject: [PATCH] Improved Docker compose files for multi-arch configuration --- Dockerfile | 3 ++- docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 62f1608..c112115 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ # Use the official Python 3.11 image # FROM --platform=arm64 python:3.11.4-bookworm -FROM python:3.11.4-bookworm +ARG BUILDPLATFORM +FROM --platform=${BUILDPLATFORM} python:3.11.4-bookworm ENV PYTHONBUFFERED 1 diff --git a/docker-compose.yml b/docker-compose.yml index aeb3df5..d79e7d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - "8083:8000" # Expose port 8083 for the web server environment: - PYTHONBUFFERED=1 - command: ["sh", "-c", "python stude/manage.py custom_migrate && python stude/wait_for_redis.py && python stude/manage.py runserver"] + command: ["sh", "-c", "python stude/manage.py makemigrations && python stude/manage.py custom_migrate && python stude/manage.py runserver"] volumes: - .:/code # For hotreloading depends_on: