Skip to content

The open alternative to Salesforce, designed for AI.

Feature/add flexibility to docker image makefile (#11210)

Paul McKeowne64c4b8ab102
diff --git a/packages/twenty-docker/Makefile b/packages/twenty-docker/Makefile
index 2d89c4c4ad9..bdda023dd5f 100644
--- a/packages/twenty-docker/Makefile
+++ b/packages/twenty-docker/Makefile
@@ -1,14 +1,27 @@
+# Makefile for building Twenty CRM docker images.
+# Set the tag and/or target build platform using make command-line variables assignments.
+#
+# Optional make variables:
+# PLATFORM - defaults to 'linux/amd64'
+# TAG - defaults to 'latest'
+#
+# Example: make
+# Example: make PLATFORM=linux/aarch64 TAG=my-tag
+
+PLATFORM ?= linux/amd64
+TAG ?= latest
+
prod-build:
- @cd ../.. && docker build -f ./packages/twenty-docker/twenty/Dockerfile --tag twenty . && cd -
+ @cd ../.. && docker build -f ./packages/twenty-docker/twenty/Dockerfile --platform $(PLATFORM) --tag twenty:$(TAG) . && cd -
prod-run:
- @docker run -d -p 3000:3000 --name twenty twenty
+ @docker run -d -p 3000:3000 --name twenty twenty:$(TAG)
prod-postgres-run:
- @docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres --name twenty-postgres twenty-postgres
+ @docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres --name twenty-postgres twenty-postgres:$(TAG)
prod-website-build:
- @cd ../.. && docker build -f ./packages/twenty-docker/twenty-website/Dockerfile --tag twenty-website . && cd -
+ @cd ../.. && docker build -f ./packages/twenty-docker/twenty-website/Dockerfile --platform $(PLATFORM) --tag twenty-website:$(TAG) . && cd -
prod-website-run:
- @docker run -d -p 3000:3000 --name twenty-website twenty-website
+ @docker run -d -p 3000:3000 --name twenty-website twenty-website:$(TAG)