Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Variables
  2. DOCKER_REGISTRY=langgenius
  3. WEB_IMAGE=$(DOCKER_REGISTRY)/dify-web
  4. API_IMAGE=$(DOCKER_REGISTRY)/dify-api
  5. VERSION=latest
  6. # Build Docker images
  7. build-web:
  8. @echo "Building web Docker image: $(WEB_IMAGE):$(VERSION)..."
  9. docker build -t $(WEB_IMAGE):$(VERSION) ./web
  10. @echo "Web Docker image built successfully: $(WEB_IMAGE):$(VERSION)"
  11. build-api:
  12. @echo "Building API Docker image: $(API_IMAGE):$(VERSION)..."
  13. docker build -t $(API_IMAGE):$(VERSION) ./api
  14. @echo "API Docker image built successfully: $(API_IMAGE):$(VERSION)"
  15. # Push Docker images
  16. push-web:
  17. @echo "Pushing web Docker image: $(WEB_IMAGE):$(VERSION)..."
  18. docker push $(WEB_IMAGE):$(VERSION)
  19. @echo "Web Docker image pushed successfully: $(WEB_IMAGE):$(VERSION)"
  20. push-api:
  21. @echo "Pushing API Docker image: $(API_IMAGE):$(VERSION)..."
  22. docker push $(API_IMAGE):$(VERSION)
  23. @echo "API Docker image pushed successfully: $(API_IMAGE):$(VERSION)"
  24. # Build all images
  25. build-all: build-web build-api
  26. # Push all images
  27. push-all: push-web push-api
  28. build-push-api: build-api push-api
  29. build-push-web: build-web push-web
  30. # Build and push all images
  31. build-push-all: build-all push-all
  32. @echo "All Docker images have been built and pushed."
  33. # Phony targets
  34. .PHONY: build-web build-api push-web push-api build-all push-all build-push-all